]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] gen estimator deadlock fix
authorRanko Zivojnovic <ranko@spidernet.net>
Wed, 18 Jul 2007 09:49:48 +0000 (02:49 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Aug 2007 15:23:58 +0000 (17:23 +0200)
commit66f2a2e33796cb356ae01887db245a3ccb4d6692
treeea61480f7d7fe10130ad79475ce0bf26abbe8b26
parent6bfc898d23fd41cc7fc1e8d0bc6a106f0e62d2ff
[PATCH] gen estimator deadlock fix

[NET]: gen_estimator deadlock fix

-Fixes ABBA deadlock noted by Patrick McHardy <kaber@trash.net>:

> There is at least one ABBA deadlock, est_timer() does:
> read_lock(&est_lock)
> spin_lock(e->stats_lock) (which is dev->queue_lock)
>
> and qdisc_destroy calls htb_destroy under dev->queue_lock, which
> calls htb_destroy_class, then gen_kill_estimator and this
> write_locks est_lock.

To fix the ABBA deadlock the rate estimators are now kept on an rcu list.

-The est_lock changes the use from protecting the list to protecting
the update to the 'bstat' pointer in order to avoid NULL dereferencing.

-The 'interval' member of the gen_estimator structure removed as it is
not needed.

Signed-off-by: Ranko Zivojnovic <ranko@spidernet.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/core/gen_estimator.c