[Top] [All Lists]

Re: modular net drivers

To: Donald Becker <becker@xxxxxxxxx>
Subject: Re: modular net drivers
From: Keith Owens <kaos@xxxxxxxxxx>
Date: Tue, 20 Jun 2000 10:29:59 +1000
Cc: Andrew Morton <andrewm@xxxxxxxxxx>, "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
In-reply-to: Your message of "Mon, 19 Jun 2000 20:19:06 -0400." <Pine.LNX.4.10.10006192011230.26261-100000@xxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Mon, 19 Jun 2000 20:19:06 -0400 (EDT), 
Donald Becker <becker@xxxxxxxxx> wrote:
>On Mon, 19 Jun 2000, Andrew Morton wrote:
>> As you may have noticed, Al Viro is running around the kernel getting
>> rid of MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT.  His long-term plan
>> is to remove MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT completely.
>> I'm looking into the changes required for the net drivers.
>Hmmm, this is curious.
>Should not the "feature freeze" phase come well after the "interface freeze"?
>This is pretty obviously an interface change.

It is also an important bug fix.  The module code has suffered from
unload races ever since the kernel locking became fine grained, users
can crash the kernel.

>> - All 2.4-only netdrivers can have all their MOD_DEC and MOD_INC calls
>>   removed.  All that twisty logic to keep track of the counts can be
>>   tossed.  A single
>"Twisty logic"?  Most of the drivers have straight-forward use counts.
>How is this new method any simpler?  If anything, it seems to be more
>complex without any obvious benefit.

There are inherent unload races when code that lives inside a module
tries to adjust the use count on that module.  To the extent that the
code pages can be deleted underneath the code that is executing!
Module use counts need to be set before entering the module, not after
the module code has started executing.

<Prev in Thread] Current Thread [Next in Thread>