Re: [PATCH] PART1: Proposed init & module changes for 2.5

Keith Owens (kaos@ocs.com.au)
Mon, 24 Sep 2001 14:54:09 +1000


On Mon, 24 Sep 2001 14:35:54 +1000,
Rusty Russell <rusty@rustcorp.com.au> wrote:
>In message <4103.1001293289@kao2.melbourne.sgi.com> you write:
>> When we discussed this at linux.conf.au in Sydney, we agreed that we
>> could call startfn after stopfn to handle the quiesce unload algorithm.
>> That handles the rmmod race without exporting mod use count to
>> everything, i.e.
>
> Yes, this was my original intention, but the more I thought
>about it, the more I wondered if it was worth it. In fact, my patch
>adds CONFIG_MODULE_UNLOAD, because most people don't actually need it,
>and I don't really care if most modules are not unloadable. Loading
>modules makes sense. Unloading them is pretty much an optimization.
>
> The reason I eventually decided to split initialization in
>this version anyway, was that so many drivers get it wrong! Things
>like registering interrupt handlers before they have set up their
>internal state, etc. Splitting it into two functions is merely a
>mechanism to get them to think about things a little harder 8)

I absolutely agree that the split between probe and register needs to
be done. The difference between calling startfn after stopfn and
forbidding that sequence is the difference between

rmmod
loses race
return OK
module is still in use, user is confused

and

rmmod
loses race
calls startfn
returns failure
module is still in use, user is happy

Allowing startfn after stopfn gives a more consistent view of the
operation.

-
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/