From owner-cvs-all@FreeBSD.ORG Thu Jun 29 15:44:46 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F173916A403; Thu, 29 Jun 2006 15:44:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2929144468; Thu, 29 Jun 2006 15:44:45 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 949D846C99; Thu, 29 Jun 2006 11:44:40 -0400 (EDT) Date: Thu, 29 Jun 2006 16:44:40 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Yar Tikhiy In-Reply-To: <20060629152426.GB67682@comp.chem.msu.su> Message-ID: <20060629164252.R30355@fledge.watson.org> References: <200606290752.k5T7qU06021639@repoman.freebsd.org> <20060629132354.D73145@mp2.macomnet.net> <20060629131201.GA67682@comp.chem.msu.su> <44A3E56E.9040705@freebsd.org> <20060629152426.GB67682@comp.chem.msu.su> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, Maxim Konovalov , src-committers@freebsd.org, Andre Oppermann , cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/net if_vlan.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2006 15:44:46 -0000 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, however. Robert N M Watson Computer Laboratory University of Cambridge