Re: kmod fix

Itai Nahshon (nahshon@actcom.co.il)
Fri, 13 Mar 1998 02:34:16 +0200


Kirk Petersen wrote:
>
> > Thats fairly horrible to get right. You also have to cope with two parallel
> > module loads going on and the case where the second kernel fork fails because
> > you are out of processes
>
> After looking at the problem last night, I got the feeling that
> there are three cases:
>
> 1. a single module is requested (it might have many dependencies but
> only one is passed through the request_module function)
>
> 2. a module is requested and loaded. Later this module loads
> other modules (ppp works this way, i think)
>
> 3. a module is requested and while loading, requests another
> module be loaded
>
> Assuming that this is a correct analysis, case number 3 is the
> real problem. Number 1 and 2 are already handled by kmod. I spent
> a while last night trying to create a patch to kmod that would solve
> number 3 but feel like fixing the offending modules would be easier.
> Now, anyone know how correct the above analysis is? I didn't
> have a chance to look at the "offending" modules much (but will certainly
> be doing that tonight).

There is another scenario, similar to 3 but more difficult to handle.
A second request_module from a different process starts while the first
one
is waiting for modprobe to finish.
The second request will not be handled, the first request may return
prematurely
because the second request calls wake_up(&kmod_queue);
The second request thinks it woke_up kmod but indeed it woke up the
waiting
request_module.
Now that second request_module is waiting on kmod_queue. Usually it gets
lucky because modprobe will finish and the kmod thread will wake it up.
There
may however be some race conditions...

The syncronization between the kmod thread and request_module must be
re-thought.
(see also my other posting on this subject).

Itai

-- 
Itai Nahshon   nahshon@actcom.co.il
        Also   nahshon@vnet.ibm.com

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