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.