Skip to content

Commit

Permalink
ifb: fix rcu_sched self-detected stalls
Browse files Browse the repository at this point in the history
[ Upstream commit 440d57b ]

According to the commit 16b0dc2
(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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dingtianhong authored and gregkh committed Jul 28, 2013
1 parent 83e4609 commit 14dfbe1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -252,8 +253,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();
Expand Down

0 comments on commit 14dfbe1

Please sign in to comment.