Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Nov 2002 01:20:56 -0500 (EST)
From:      Jeff Roberson <jroberson@chesapeake.net>
To:        Andrea Campi <andrea@webcom.it>
Cc:        current@FreeBSD.ORG
Subject:   Re: Deadlock during buildworld
Message-ID:  <20021109011822.N14121-100000@mail.chesapeake.net>
In-Reply-To: <20021108095956.GA44675@webcom.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021109011822.N14121-100000>