From owner-freebsd-current@FreeBSD.ORG Thu Feb 7 10:16:11 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D18C16A420 for ; Thu, 7 Feb 2008 10:16:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.185]) by mx1.freebsd.org (Postfix) with ESMTP id 893C613C4CE for ; Thu, 7 Feb 2008 10:16:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by mu-out-0910.google.com with SMTP id w9so2490000mue.6 for ; Thu, 07 Feb 2008 02:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=7vbRsr1v4FEda7i5lF5Oa0JBSpwkn8J1CFcAU5nVif4=; b=so2Qqsk1S3F+S0R6c24jjTcooPlASmLlju/yEkc7G+Cl+71X17r07mv36zeyhOv/3gBUHk3S9DSeNI3Jq8UgmU60eTVjsRfl8KJXLS3Tsg7Z4DxrKNzKI6d+kTd72hRq6RtAsFSWs0BogOprLa64VUOYEpSbZwoyb/5u4vpY4OI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Ds9abIIIgr7dqHeiJwjzH7IcYh88CfTtwnCTFEdMeHbtZMVngTLh9roPDOpfikcIwLJXoIjgV3K6ezxYpPOF4p4HFMJ5g3gVHbyM9fK7B7VKeU1pGrc7VcDQey2xeAdy9WXy1KHj6f3pQWBcY/S75R8imfgh0YsqQKUZ7eE3FSA= Received: by 10.86.71.1 with SMTP id t1mr10232437fga.33.1202379368912; Thu, 07 Feb 2008 02:16:08 -0800 (PST) Received: by 10.86.28.19 with HTTP; Thu, 7 Feb 2008 02:16:08 -0800 (PST) Message-ID: <3bbf2fe10802070216idd5206ey7a66c0873311e66c@mail.gmail.com> Date: Thu, 7 Feb 2008 11:16:08 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Kostik Belousov" In-Reply-To: <20080207045015.GW57756@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080207045015.GW57756@deviant.kiev.zoral.com.ua> X-Google-Sender-Auth: b4735481d9e0cda4 Cc: Marcel Moolenaar , current@freebsd.org Subject: Re: Old LOR between devfs & devfsmount resurfacing? 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: Thu, 07 Feb 2008 10:16:11 -0000 2008/2/7, Kostik Belousov : > On Wed, Feb 06, 2008 at 11:11:06AM -0800, Marcel Moolenaar wrote: > > All, > > > > I just ran into the following LOR after upgrading my PowerPC box: > > > > lock order reversal: > > 1st 0xdbee94 devfs (devfs) @ /nfs/freebsd/8.x/src/sys/kern/ > > vfs_subr.c:2061 > > 2nd 0xdfb014 devfsmount (devfsmount) @ /nfs/freebsd/8.x/src/sys/fs/ > > devfs/devfs_vnops.c:201 > > KDB: stack backtrace: > > 0xdc0febc8: at kdb_backtrace+0x4c > > 0xdc0febd8: at witness_checkorder+0x704 > > 0xdc0fec28: at _sx_xlock+0x8c > > 0xdc0fec48: at devfs_allocv+0x138 > > 0xdc0fec88: at devfs_root+0x5c > > 0xdc0fecb8: at set_rootvnode+0x44 > > 0xdc0fece8: at vfs_mountroot+0x344 > > 0xdc0fed48: at start_init+0x88 > > 0xdc0feda8: at fork_exit+0xb4 > > 0xdc0fedc8: at fork_trampoline+0xc > > KDB: enter: witness_checkorder > > [thread pid 1 tid 100001 ] > > Stopped at 0x28ee68: addi r0, r0, 0x0 > > > > It seems that this is a LOR reported in 2006 and fixed > > in 2006 as well. Do other people see this too, or should > > I suspect my sources? > > > I believe this is a false positive, caused by the way the witness works. > Attilio recently added the witness support for the lockmgr, that caused > this and at least two more LORs to be printed on startup. > > Correct lock order is devfs vnode -> devfs mount sx lock. When > allocating new devfs vnode, see devfs_allocv(), the newly created > vnode is locked while devfs mount lock already held (see line 250 of > fs/devfs/devfs_vnops.c). Nonetheless, this cannot cause deadlock since > no other thread can find the new vnode, and thus perform the other lock > order for this vnode lock. > > The fix is to shut the witness in this particular case. Attilio, how to > do this ? Just add LK_NOWITNESS for one of the lock involved in the lockinit(). Attilio -- Peace can only be achieved by understanding - A. Einstein