]> git.hungrycats.org Git - linux/commitdiff
ifb: fix rcu_sched self-detected stalls
authordingtianhong <dingtianhong@huawei.com>
Wed, 10 Jul 2013 04:04:02 +0000 (12:04 +0800)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 May 2014 05:53:45 +0000 (07:53 +0200)
[ Upstream commit 440d57bc5ff55ec1efb3efc9cbe9420b4bbdfefa ]

According to the commit 16b0dc29c1af9df341428f4c49ada4f626258082
(dummy: fix rcu_sched self-detected stalls)

Eric Dumazet fix the problem in dummy, but the ifb will occur the
same problem like the dummy modules.

Trying to "modprobe ifb numifbs=30000" triggers :

INFO: rcu_sched self-detected stall on CPU

After this splat, RTNL is locked and reboot is needed.

We must call cond_resched() to avoid this, even holding RTNL.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[wt: 2.6.32: cond_resched() needs linux/sched.h]
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/net/ifb.c

index 030913f8bd26ef40876170abad2fb93e7215e16e..cfd55107149f479e903fc35ce698b52cc45255c9 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/etherdevice.h>
 #include <linux/init.h>
 #include <linux/moduleparam.h>
+#include <linux/sched.h>
 #include <net/pkt_sched.h>
 #include <net/net_namespace.h>
 
@@ -269,8 +270,10 @@ static int __init ifb_init_module(void)
        rtnl_lock();
        err = __rtnl_link_register(&ifb_link_ops);
 
-       for (i = 0; i < numifbs && !err; i++)
+       for (i = 0; i < numifbs && !err; i++) {
                err = ifb_init_one(i);
+               cond_resched();
+       }
        if (err)
                __rtnl_link_unregister(&ifb_link_ops);
        rtnl_unlock();