From owner-freebsd-current@FreeBSD.ORG Wed Aug 10 10:02:25 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA86616A41F; Wed, 10 Aug 2005 10:02:25 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3248043D48; Wed, 10 Aug 2005 10:02:25 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id j7AA2D0U099849; Wed, 10 Aug 2005 03:02:17 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200508101002.j7AA2D0U099849@gw.catspoiler.org> Date: Wed, 10 Aug 2005 03:02:13 -0700 (PDT) From: Don Lewis To: ssouhlal@FreeBSD.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: kan@FreeBSD.org, freebsd-current@FreeBSD.org, thierry@herbelot.com Subject: Re: panic: lock (sleep mutex) vnode interlock not locked X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2005 10:02:25 -0000 On 10 Aug, Suleiman Souhlal wrote: > Hello, > > On Aug 10, 2005, at 1:55 AM, Alexander Kabaev wrote: > >> On Tue, Aug 09, 2005 at 10:33:12PM +0200, Thierry Herbelot wrote: >> >>> Hello, >>> >>> I'm seeing the above panic on two machines (SMP BP6 and a >>> notebook) with >>> recent -Current (certainly "heisenbug" : the same kernel runs >>> happily on the >>> notebook). >>> The panic log on the SMP machine follows. >>> >>> TfH >>> >> >> >> Hi, >> >> could you try an patch below? > > If you look at the place where the panic is happening, vlrureclaim(), > you'll notice that it shouldn't be possible for vgonel() to be called > on a doomed vnode. It seems, from KTR traces gotten by kris, that > there is a race between vlrureclaim() and vnlru_free() (called also > in getnewvnode()), but I've been unable to find it. if ((vp->v_iflag & VI_DOOMED) != 0 || vp->v_usecount || !LIST_EMPTY(&(vp)->v_cache_src) || (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VI_UNLOCK(vp); continue; } MNT_IUNLOCK(mp); vholdl(vp); if (VOP_LOCK(vp, LK_INTERLOCK|LK_EXCLUSIVE, td)) { vdrop(vp); MNT_ILOCK(mp); continue; } VI_LOCK(vp); vgonel(vp); What is preventing VI_DOOMED from being set while we're waiting for VOP_LOCK()? Contrary to what the VOP_LOCK(9) man page says about LK_INTERLOCK, it looks like lockmgr() drops the vnode interlock before it attempts to grab the vnode lock.