我觉得不太对啊,一个软中断虽然不会被另一个软中断“中断”,但是可能被硬中断“中断”,而硬中断最后还是要执行到软中断,因此还是会形成对资源的临界区访问。我觉得在保护软中断时,应该关闭本地软中断,比如用local_bh_disable
不知道这样理解对不对?
--
章巍巍
_______________________________________________
Linux 内核开发中文邮件列表
Linux-...@zh-kernel.org
http://zh-kernel.org/mailman/listinfo/linux-kernel
Linux 内核开发中文社区: http://zh-kernel.org
而
asmlinkage void do_softirq(void)
{
unsigned long flags;
struct thread_info *curctx;
union irq_ctx *irqctx;
u32 *isp;
if (in_interrupt())
return;
....
}
可以看到,in_interrupt 判断,当前若是从硬件中断退出后执行的irq_exit进入的do_softirq,则立即返回,可以避免你说的情况
在 11-7-15,章巍巍<zhangw...@gmail.com> 写道: