From owner-freebsd-current@FreeBSD.ORG Mon Dec 1 23:07:59 2003 Return-Path: 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 5F04516A4D0; Mon, 1 Dec 2003 23:07:59 -0800 (PST) Received: from white.imgsrc.co.jp (ns.imgsrc.co.jp [210.226.20.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1FC943F3F; Mon, 1 Dec 2003 23:07:57 -0800 (PST) (envelope-from kuriyama@imgsrc.co.jp) Received: from localhost (localhost [127.0.0.1]) by white.imgsrc.co.jp (Postfix) with ESMTP id 07A07284094; Tue, 2 Dec 2003 16:07:57 +0900 (JST) Received: from black.imgsrc.co.jp (black.imgsrc.co.jp [2001:218:422:2::130]) by white.imgsrc.co.jp (Postfix) with ESMTP id 06DF128408C; Tue, 2 Dec 2003 16:07:56 +0900 (JST) Received: from black.imgsrc.co.jp (black.imgsrc.co.jp [2001:218:422:2::130]) by black.imgsrc.co.jp (Postfix) with ESMTP id D74461E4A63; Tue, 2 Dec 2003 16:07:55 +0900 (JST) Date: Tue, 02 Dec 2003 16:07:55 +0900 Message-ID: <7m8ylvbstw.wl@black.imgsrc.co.jp> From: Jun Kuriyama To: Robert Watson In-Reply-To: References: <7mad6bbul4.wl@black.imgsrc.co.jp> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS snapshot-20020531 cc: Current Subject: Re: -current lockup (how to diagnose?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 02 Dec 2003 07:07:59 -0000 At Tue, 2 Dec 2003 01:45:43 -0500 (EST), Robert Watson wrote: > Could you try compiling in DEBUG_LOCKS into your kernel and doing "show > lockedvnods" with that? Okay. I'll use new kernel with DEBUG_LOCKS. > Unfortunately, someone removed the pid from the > output of that command, but didn't add the thread pointer to the DDB ps > output, so you'll probably need to modify the lockmgr_printinfo() function > in vfs_subr.c to print out lkp->lk_lockholder->td_proc->p_pid as well for > exclusive locks. I don't understand what it means, but I'll try with this modification. Index: kern_lock.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_lock.c,v retrieving revision 1.70 diff -u -r1.70 kern_lock.c --- kern_lock.c 16 Jul 2003 01:00:38 -0000 1.70 +++ kern_lock.c 2 Dec 2003 07:04:49 -0000 @@ -611,8 +611,8 @@ printf(" lock type %s: SHARED (count %d)", lkp->lk_wmesg, lkp->lk_sharecount); else if (lkp->lk_flags & LK_HAVE_EXCL) - printf(" lock type %s: EXCL (count %d) by thread %p", - lkp->lk_wmesg, lkp->lk_exclusivecount, lkp->lk_lockholder); + printf(" lock type %s: EXCL (count %d) by thread %p (pid:%d)", + lkp->lk_wmesg, lkp->lk_exclusivecount, lkp->lk_lockholder, lkp->lk_lockholder->td_proc->p_pid); if (lkp->lk_waitcount > 0) printf(" with %d pending", lkp->lk_waitcount); } > It looks like maybe something isn't releasing a vnode > lock before returning to userspace. I have some patches to assert that no > lockmgr locks are held on the return to userspace, but I'll have to dig > them up tomorrow and send them to you. Basically, it adds a per-thread > lockmgr lock count in a thread-local variable, incrementing for each lock, > and decrementing for each release, and then KASSERT()'s in userret that > the variable is 0. Thanks! I'm waiting for your patch. -- Jun Kuriyama // IMG SRC, Inc. // FreeBSD Project