kmod races

Petr Vandrovec Ing. VTEI (VANDROVE@vc.cvut.cz)
Thu, 9 Apr 1998 19:21:18 MET-1


Hello Kirk, hello everybody,
I'm not so familiar with interruptible_sleep_on() and wakeup(),
but kmod has big troubles on my system (currently 2.1.94).
Problem is in that request_module() wakes up another thread (which
is currently waiting for modprobe completion) instead of enqueuing request
into something (queue... or SYSV IPC ? :-) ).
In rc.local startup script I have:

...
(cd /netstat; su nopriv -c ./checknetwork >>results 2>&1 ) &
. /etc/rc.d/rc.ncpfs start
...

where checknetwork opens /dev/dsp0 (i.e. kernel requests sound, which in
turn requests sb and mad16 and it takes very long...)
and rc.ncpfs tries to mount two NCP volumes from NW server (i.e. it twice
invokes mount(..,"ncpfs",...) which in turn requests module "ncpfs").
And now bad things happen:

1) at beginning we have kmod_thread sleeping in kmod_queue
2) now checknetwork requests "sound". So kmod_thread is running and
checknetwork sleeps in kmod_queue
3a) modprobe is heavily running
3b) "rc.ncpfs start" calls "ncpmount" which requests mount(...,"ncpfs"...)
4) now (!) ncpmount wakes up checknetwork and put itself into kmod_queue
5) checknetwork fails to open /dev/dsp0...
6) now modprobe(sound) finishes and kmod_thread wakes up ncpmount
7a) kmod_thread goes to sleep :-( no ncpfs is loaded
7b) ncpmount fails with "NCPFS not supported"
8) second ncpmount tries to mount(...,"ncpfs"...)
9) kmod_thread is awaken, modprobes(ncpfs) and returns... ncpfs is loaded

So final result is that one of ncpfs volumes is not mounted :-(
And because of I'm not highly exprienced kernel hacker, there is
no patch to kmod from me at this time.
Petr Vandrovec
vandrove@vc.cvut.cz

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