Re: "new style" netdevice allocation patch for TUN driver (2.4.18 kernel)

From: Jacek Konieczny (
Date: Tue Aug 06 2002 - 12:29:21 EST

On Tue, Aug 06, 2002 at 10:07:49AM -0700, Maksim (Max) Krasnyanskiy wrote:
> >I will not see "waiting for" warning, but I will also be able to control
> >all other network devices. Without this "fix" I am not able to shutdown
> >network at all. Every "ip" command just hangs forever.
> Yeah, this should be fixed. unregister_netdevice() sleeps under rtnl_lock().
> Which means that any other activity that needs this lock will be blocked.
I am happy, that someone (smarter than me) seems to be interested in
fixing this bug :-)

> >But it seems it is eventually called. The refcount eventually goes to 0
> >(1 in factm - selfreference). Without this patch it never went to 0, as
> >system shutdown was stopped "waitnig for...".
> It'd be nice to trace what part of the kernel is actually holding refcount.
If I ever find something more precise I'll write.

> >was bug-free. With this patch it is more bug-proof.
> :) No, the point of device destructors is not to hide kernel bugs.
> for a long time after deregistration. I may very well be doing it for a
> good reason but warning is helpful anyway.
I undarstand this. Even with my (now I know - broken) patch kernel warns
that device is in use, and that destruction will be delayed.
But you are right, warning displayed every 3 seconds, when nothing else
works is much easier to notice :-)

> And we should fix sleep in unregister_netdevice() (ie patch above).
I think this would be enough for me.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:32 EST