From: "Maksim (Max) Krasnyanskiy" <maxk@qualcomm.com>
To: "David S. Miller" <davem@redhat.com>
Cc: jajcus@bnet.pl, linux-kernel@vger.kernel.org
Subject: Re: "new style" netdevice allocation patch for TUN driver (2.4.18 kernel)
Date: Tue, 06 Aug 2002 13:03:48 -0700 [thread overview]
Message-ID: <5.1.0.14.2.20020806125053.09751470@mail1.qualcomm.com> (raw)
In-Reply-To: <20020806.100749.21530590.davem@redhat.com>
> From: "Maksim (Max) Krasnyanskiy" <maxk@qualcomm.com>
> Date: Tue, 06 Aug 2002 10:07:49 -0700
>
> Dave, how about this
>
> --- net/core/dev.c.orig Mon Aug 5 21:48:54 2002
> +++ net/core/dev.c Mon Aug 5 21:54:01 2002
> @@ -2577,6 +2577,11 @@
>
>First, the call-chain notifiers are probably not safe
>to run without rtnl_lock held.
Good point.
>Second, why not just fix the bug instead of applying band-aids
>to device unregistry? I know it's nice in that it allows you
>to configure devices some more, but it doesn't make the real
>problem go away.
I completely agree. However sleeping and holding a lock that you
don't have to hold is a bug on it's own :).
Things like sockets drop the lock before calling schedule() and acquire
it on wakeup. I think we should do the same in unregister_netdevice().
How about this:
--- dev.c.orig Tue Aug 6 00:58:46 2002
+++ dev.c Tue Aug 6 01:00:00 2002
@@ -2584,9 +2584,12 @@
notifier_call_chain(&netdev_chain,
NETDEV_UNREGISTER, dev);
}
+ rtnl_unlock();
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ/4);
current->state = TASK_RUNNING;
+ rtnl_lock();
+
if ((jiffies - warning_time) > 10*HZ) {
printk(KERN_EMERG "unregister_netdevice: waiting
for %s to "
"become free. Usage count = %d\n",
-----
Max
next prev parent reply other threads:[~2002-08-06 20:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-01 13:35 Jacek Konieczny
2002-08-02 23:54 ` Maksim (Max) Krasnyanskiy
[not found] ` <20020803140858.GA5314@nic.nigdzie>
2002-08-06 17:07 ` Maksim (Max) Krasnyanskiy
2002-08-06 17:07 ` David S. Miller
2002-08-06 20:03 ` Maksim (Max) Krasnyanskiy [this message]
2002-08-06 17:29 ` Jacek Konieczny
2002-08-07 3:10 Julian Anastasov
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=5.1.0.14.2.20020806125053.09751470@mail1.qualcomm.com \
--to=maxk@qualcomm.com \
--cc=davem@redhat.com \
--cc=jajcus@bnet.pl \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®