Re: pre-patch-2.1.107 breaks kmod

Keith Owens (kaos@ocs.com.au)
Sun, 28 Jun 1998 11:46:01 +1000


On Sat, 27 Jun 1998 17:31:06 -0700,
Richard Henderson <rth@dot.cygnus.com> wrote:
>On Sat, Jun 27, 1998 at 12:46:41PM +1000, Keith Owens wrote:
>> Aren't we missing something here? insmod is not the only thing that
>> hits loaded modules, rmmod does as well. Consider the race
>>
>> insmod x.o
>> insmod x.o rmmod x.o in parallel
>
>Why in the world are you concerned about this? Rmmod already
>serializes "fine" with insmod. In that the kernel keeps the
>data structures in a sane state, but that the users of said
>modules are bound to loose no matter what.

Kernel structures are not a problem, I know they still serialize.

Concerned because the discussion mentioned moving the unit of locking
outboard from the kernel to userspace via insmod file locking or some
other means. rmmod was not going to participate in the userspace lock
which set off an alarm bell, a locking scheme which excludes one of the
participants worries me. It might be right, but I thought it needed
raising.

>Um, no, that's not what it does. It waits for the lock, tries to
>create the module, and if that fails with EEXIST, returns OK.

And is this safe *in userspace* against a parallel rmmod. The whole
point of the discussion was to present a consistent userspace response
against multiple insmods. I just query whether rmmod needs to be
considered as well. Are there any paths under multiple insmods and
rmmods that can lead to some of the insmods reporting OK and others
reporting failure? If so, the interface is still not consistent.

Contrived I know, but somebody will do it one day.

>"Doc, it hurts when I do this."
>"Don't do that."

But I didn't, the system did it. Which is where we came in. :)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu