cvs commit: src/sys/net if_vlan.c

Robert Watson rwatson at
Thu Jun 29 15:44:46 UTC 2006

On Thu, 29 Jun 2006, Yar Tikhiy wrote:

>>> I stress tested gif(4) in the same manner for kicks and got a very similar 
>>> panic in in_control().  I suppose that my change eliminated a concurrency 
>>> problem in vlan(4) and we began to feel the lack of refcounting at ifnet 
>>> level.  Indeed, a thread can keep a pointer to an ifnet beyond its 
>>> lifetime and panic the system on access to the dead ifnet.
>> For the time being we should simply mark ifnet's dead but keep them around. 
>> Refcounting is most likely too expensive, especially on larger SMP systems. 
>> All users of ifnets then have to be teached to obey the dead flag.
> AFAIK we refcount vnodes, which are an object used rather heavily. Do you 
> think refcounting ifnets would be worse than that?

The specific problem Andre is referencing implicitly is that one of the types 
of objects that references ifnets is the mbuf pkthdr ifnet pointer. 
Obviously, refcount operations for every mbuf ifnet ref/deref would be a big 
problem.  However, nothing says we can't use refcounts for only objects where 
we are willing to pay the expense, such as for encapsulation interfaces, etc, 

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the cvs-src mailing list