Date: Tue, 02 Dec 2003 16:07:55 +0900 From: Jun Kuriyama <kuriyama@imgsrc.co.jp> To: Robert Watson <rwatson@FreeBSD.org> Cc: Current <freebsd-current@FreeBSD.org> Subject: Re: -current lockup (how to diagnose?) Message-ID: <7m8ylvbstw.wl@black.imgsrc.co.jp> In-Reply-To: <Pine.NEB.3.96L.1031202013204.57038S-100000@fledge.watson.org> References: <7mad6bbul4.wl@black.imgsrc.co.jp> <Pine.NEB.3.96L.1031202013204.57038S-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <kuriyama@imgsrc.co.jp> // IMG SRC, Inc. <kuriyama@FreeBSD.org> // FreeBSD Project
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7m8ylvbstw.wl>