[NET_SCHED] protect action config/dump from irqs
authorJamal Hadi Salim <hadi@cyberus.ca>
Wed, 12 Sep 2007 14:32:59 +0000 (16:32 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 14 Sep 2007 23:43:05 +0000 (16:43 -0700)
commite1e992e52faa588667e1378a2573b4b8e3fa6670
tree771f664db9e2d7119dfea92a117deeb89e7b55e5
parent4878809f711981a602cc562eb47994fc81ea0155
[NET_SCHED] protect action config/dump from irqs

(with no apologies to C Heston)

On Mon, 2007-10-09 at 21:00 +0800, Herbert Xu wrote:
On Sun, Sep 02, 2007 at 01:11:29PM +0000, Christian Kujau wrote:
> >
> > after upgrading to 2.6.23-rc5 (and applying davem's fix [0]), lockdep
> > was quite noisy when I tried to shape my external (wireless) interface:
> >
> > [ 6400.534545] FahCore_78.exe/3552 just changed the state of lock:
> > [ 6400.534713]  (&dev->ingress_lock){-+..}, at: [<c038d595>]
> > netif_receive_skb+0x2d5/0x3c0
> > [ 6400.534941] but this lock took another, soft-read-irq-unsafe lock in the
> > past:
> > [ 6400.535145]  (police_lock){-.--}
>
> This is a genuine dead-lock.  The police lock can be taken
> for reading with softirqs on.  If a second CPU tries to take
> the police lock for writing, while holding the ingress lock,
> then a softirq on the first CPU can dead-lock when it tries
> to get the ingress lock.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c
net/sched/act_police.c