tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Locking for module_autoload() (was: Modules loading modules?)



On Aug,Monday 2 2010, at 4:27 AM, Paul Goyette wrote:

> On Sun, 1 Aug 2010, John Nemeth wrote:
> 
>>    I'm thinking the acquisition of module_lock should be pushed into
>> module_autoload() instead of having the caller acquire it for this very
>> reason.  It makes it hard to change the way locking works in the
>> MODULAR code if you expect the caller to acquire the lock.  I don't
>> know why it was done this way originally, or what the consequences (if
>> any) would be for making the change.  Andrew, any thoughts on this?
> 
> Attached are diffs for moving the locking out of each caller and into 
> module_autoload() itself.  Most of these changes are fairly trivial, but a 
> couple of them should be looked at more closely in case I've missed any 
> subtleties in the original code:
> 
>       kern/kern_syscall.c
>       net/if_ppp.c

I think that this patch has same problem as original code you can call 
module_autoload twice in same lwp. (you are holding module_lock while calling 
module_do_load).

Regards

Adam.



Home | Main Index | Thread Index | Old Index