>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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/