Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH] dummy: fix rcu_sched self-detected stalls
Date: Sat, 09 Jun 2012 12:59:06 +0200	[thread overview]
Message-ID: <1339239546.6001.177.camel@edumazet-glaptop> (raw)

From: Eric Dumazet <edumazet@google.com>

Trying to "modprobe dummy numdummies=30000" triggers :

INFO: rcu_sched self-detected stall on CPU { 8} (t=60000 jiffies)

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

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

Also remove the ~32767 limit on number of dummies (PAGE_SIZE*8)

Tested with "modprobe dummy numdummies=128000"
(it took ~12 minutes, because of sysfs)

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 drivers/net/dummy.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 442d91a..004ca81 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -160,12 +160,14 @@ static struct rtnl_link_ops dummy_link_ops __read_mostly = {
 module_param(numdummies, int, 0);
 MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices");
 
-static int __init dummy_init_one(void)
+static int __init dummy_init_one(int index)
 {
 	struct net_device *dev_dummy;
 	int err;
+	char name[64];
 
-	dev_dummy = alloc_netdev(0, "dummy%d", dummy_setup);
+	sprintf(name, "dummy%d", index);
+	dev_dummy = alloc_netdev(0, name, dummy_setup);
 	if (!dev_dummy)
 		return -ENOMEM;
 
@@ -187,8 +189,10 @@ static int __init dummy_init_module(void)
 	rtnl_lock();
 	err = __rtnl_link_register(&dummy_link_ops);
 
-	for (i = 0; i < numdummies && !err; i++)
-		err = dummy_init_one();
+	for (i = 0; i < numdummies && !err; i++) {
+		err = dummy_init_one(i);
+		cond_resched();
+	}
 	if (err < 0)
 		__rtnl_link_unregister(&dummy_link_ops);
 	rtnl_unlock();

             reply	other threads:[~2012-06-09 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-09 10:59 Eric Dumazet [this message]
2012-06-11  5:48 ` [PATCH] dummy: fix rcu_sched self-detected stalls David Miller
2012-06-11  7:11   ` [PATCH v2] " Eric Dumazet
2012-06-11 16:51     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339239546.6001.177.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox