From owner-freebsd-current Fri Nov 8 22:21: 3 2002 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 CBC6937B401 for ; Fri, 8 Nov 2002 22:21:01 -0800 (PST) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F62B43E4A for ; Fri, 8 Nov 2002 22:21:01 -0800 (PST) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id gA96KuO32203; Sat, 9 Nov 2002 01:20:56 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Sat, 9 Nov 2002 01:20:56 -0500 (EST) From: Jeff Roberson To: Andrea Campi Cc: current@FreeBSD.ORG Subject: Re: Deadlock during buildworld In-Reply-To: <20021108095956.GA44675@webcom.it> Message-ID: <20021109011822.N14121-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 8 Nov 2002, Andrea Campi wrote: > Hi all, > > for months now I've been having a reproducible hang under load > (make -j4 buildworld on a uniprocessor with plenty of RAM). I transcribed > some info which might be useful to debug it; it seems to me this is a > deadlock (am I right?). I'll leave the laptop in ddb so I can provide > more info. > > This is last week current; I had seen a few commits I thought might fix > this but no. > > > db> show locked > Locked vnodes > 0xc202ca68: tag ufs, type VDIR, usecont 1, writecount 0, refcount 2, flags (VV_OBJBUF), lock type ufs: EXCL (count 1) by pid 53304 > ino 31744, on dev ad2s2f (4, 16) > 0xc27e04a0: tag ufs, type VREG, usecount 18, writecount 0, refcount 1, flags (VV_TEXT|VV_OBJBUF), lock type ufs: EXCL (count 1) by pid 53301 with 3 pending > ino 87582, on dev ad2s2f (4, 16) > 0xc2c13940: tag ufs, type VREG, usecount 18, writecount 0, refcount 1, flags (VV_TEXT|VV_OBJBUF), lock type ufs: EXCL (count 1) by pid 53302 with 3 pending > ino 33113, on dev ad2s2f (4, 16) > At first glance, I think the following patch might fix it: Index: kern_exec.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exec.c,v retrieving revision 1.197 diff -u -r1.197 kern_exec.c --- kern_exec.c 5 Nov 2002 18:04:50 -0000 1.197 +++ kern_exec.c 9 Nov 2002 06:02:25 -0000 @@ -628,14 +628,14 @@ if (imgp->firstpage) exec_unmap_first_page(imgp); - if (imgp->stringbase != NULL) - kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase, - ARG_MAX + PAGE_SIZE); - if (imgp->vp) { NDFREE(ndp, NDF_ONLY_PNBUF); vput(imgp->vp); } + + if (imgp->stringbase != NULL) + kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase, + ARG_MAX + PAGE_SIZE); if (imgp->object) vm_object_deallocate(imgp->object); I'll look into it some more, but it looks like someone is holding the exec map while they are trying to lock that vnode. That doesn't seem correct, but this patch will fix the problem if that is the case. It's too bad we dont have witness on lockmgr.. Thanks, Jeff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message