Re: netgraph(4) initialization order

From: Maksim Yevmenkin <maksim.yevmenkin_at_savvis.net>
Date: Wed, 05 Jan 2005 13:18:05 -0800
Scott Long wrote:
> Maksim Yevmenkin wrote:
> 
>> Scott Long wrote:
>> 
>>> Maksim Yevmenkin wrote:
>>> 
>>>> Dear Hackers,
>>>> 
>>>> any objections to the attached patch?
>>>> 
>>> 
>>> Yes, as I stated in another email, I think that the core netgraph
>>>  module should be initialized before the SI_SUB_DRIVERS step.  I 
>>> propose creating a new sysinit called SI_SUB_NETGRAPH with a
>>> value of 0x30100000.  That way it comes after SI_SUB_IF and
>>> before SI_SUB_DRIVERS.  This make fiddling with SI_ORDER_*
>>> unneccesary.
>> 
>> 
>> 
>> how about new attached patch?
>> 
>> thanks, max
>> 
> 
> Exactly what I had in mind =-)  Have you tested this out to make sure
>  it fixes the problem cases?

i'm building kernel now, but i'm almost certain it will fix the problem. 
the stack trace i got points to ng_newtype() calling ng_findtype() that 
wants to mtx_lock(ng_typelist_mtx). i'm pretty sure the ng_typelist_mtx 
mutex was not initialized, that is ngb_mod_event() was never called.

panic: mtx_lock() of spin mutex (null) _at_ 
/usr/src/sys/netgraph/ng_base.c:1189

no mutex name and ng_typelist_mtx is *not* a spin mutex.

ng_ubt(4) calls ng_newtype() from its mod_event handler, so i think 
ng_ubt(4) mod_event handler was called before ngb_mod_event().

thanks,
max
Received on Wed Jan 05 2005 - 20:18:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:25 UTC