On Thu, Jun 10, 2004 at 16:23:31 +0530, Anandraj wrote: > Hi Jan and Amit, > yep u r right guys , > But the doubt that arises on my mind is that > > what happens now whn the rmmod is called ? > > Now taking the senario , that 'l x' has stated , > u r module has been registerd, ie(insmod is done) > the function XX_open() may or maynot be invoked , > since the MOD_INC_COUNT has not been incremented we > cannot say for sure that it didnt invoke the XX_Open func, > Possiblites are there that the module might have got struck before > MOD_INC_COUNT > Statement. That's why the module use count is manipulated from outside! Some structures, like a filesystem structure, device structure and similar have an owner filed. This field is initialized to the module struct of module that registered it. And when filesystem is mounted, device is mounted, etc., the module use count is incremented before call to that module is made. And decremented again after umount/close.... If you manage to unload a module, to which pointers exist somewhere in kernel (like when it's device is open), the system is will crash promptly. > In the above senario can u guys plz tell me what will happen if i call > rmmod, > and is it possible to kill the module in above state ,in - 2.6 (preemptable > Kernel). The preemptability of the kernel does not matter -- it's behaviour is equivalent to a non-preemptible SMP (and SMP is much more common now that there is hyperthreading) ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz>
Attachment:
signature.asc
Description: Digital signature