Re: [PATCH][ATM] use rtnl_{lock,unlock} during device operations

David S. Miller (davem@redhat.com)
Fri, 06 Jun 2003 07:07:47 -0700 (PDT)


From: Werner Almesberger <wa@almesberger.net>
Date: Fri, 6 Jun 2003 10:57:53 -0300

What should help in the ATM code is that it pushes synchronization
"down", i.e. "close" functions usually can't return until they are
truly done (or at least have made sure there is nothing externally
visible left).

If we move over to a more netdevice-based design for ATM,
this will not longer be acceptable.

Unregister of netdevices is %100 asynchronous, even if references
remain (and even if the device is UP!), we close then rip the device
out of the kernel. As references go away we finally get to zero
and thus can finally kfree() up the netdevice.

This has some problems currently which Al and myself are fixing. In
the final analysis we'll even handle things like stray SYSFS and
PROCFS references by marking the device "dead" at unregister time
and any post-unregister reference will see this and error out.

This is a much better model than synchronizing everything, you tie
your hands when you do it that way and it tends to lead to module
unload deadlocks.
-
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/