Re: Problem with dev_kfree_skb_any() in 2.6.0

From: Benjamin Herrenschmidt
Date: Sun Dec 28 2003 - 00:49:03 EST


On Sun, 2003-12-28 at 12:07, David S. Miller wrote:
> On Sun, 28 Dec 2003 10:17:34 +1100
> Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > We should probably fix dev_kfree_skb_any() ? Still ugly imho though...
> >
> > - if (in_irq())
> > + if (in_irq() || irqs_disabled())
> >
>
> That's not the right fix, the sungem PM code path TX queue
> packet freeing should be instead done outside of IRQ spinlocks.
>
> .../...

The "workaround" is a bit complicated, but I'll look into it,
I could probably get the whole clean ring thing out of the
spinlock instead (I need to reduce time spent in those locks
anyway).

Though it's really inconsistent imho, to have that routine that
can be called at task time, interrupt time, but not task time with
a spinlock held... especially since it's called *kfree*, I would
have expected kfree-like semantics...

Note that among the drivers broken with that same bug (typically
in the close() path) are :

- sunhme
- b44
- tg3
- ...

Almost all drivers calling dev_kfree_skb_any() do that within a
spinlock_irq ...

Ben.


-
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/