Soft IRQs

From: Jamie Iles
Date: Mon May 12 2008 - 09:37:22 EST


Hi,

I am trying to understand whether it is correct behaviour for soft IRQs to be executed when interrupts with disabled. In particular, if I have some code that does:

spin_lock_t mylock = SPIN_LOCK_UNLOCKED;
unsigned long flags;
spin_lock_irqsave( &mylock, flags );
...
spin_lock_irqrestore( &mylock, flags );

Can soft IRQs run in the critical section above? I have a problem where 'local_bh_enable_ip()' is being called as a result of 'dev_kfree_skb()' and a NET_RX_SOFTIRQ is being raised when I expect interrupts to be disabled.

'local_bh_enable()' only uses the 'in_irq()' macro to check whether we should do 'do_softirq()' and it also only checks we do not have the softirq field of 'preempt_count' non-zero before enabling soft IRQs.

I can see that if I was to replace 'spin_lock_irqsave()' with 'spin_lock_bh()' then the softirq field of 'preempt_count' would be incremented and prevent soft IRQs until the lock was released. Should 'spin_lock_irqsave()' also disable soft interrupts?

Thanks,

Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/