Re: question on context of kfree_skb()

Manfred Spraul (
Mon, 30 Dec 2002 23:32:49 +0100

Mulix wrote:

>dev_kfree_skb_any() should be called when you could be either
>executing in interrupt context or not.
dev_kfree_skb_any() can misdetect the context: You must not use the
function if you hold an irq spinlock and you might be running from BH or
process context.

cpu 1: cpu 2:
acquire one of the networking bh lock
acquire the driver spin_lock_irq()
hardware interrupt
try to acquire the driver irq spinlock
--> spin.
dev_kfree_skb_any(): !in_irq(), calls kfree_skb
kfree_skb tries to acquire the network lock that
cpu 1 owns
--> spin.

And deadlock.


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at