From owner-freebsd-alpha Sat Dec 14 17:41:20 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 388E237B401; Sat, 14 Dec 2002 17:41:18 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE14443EC2; Sat, 14 Dec 2002 17:41:17 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.5) with ESMTP id gBF1fHOM060371; Sat, 14 Dec 2002 17:41:17 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.5/Submit) id gBF1fHJc060370; Sat, 14 Dec 2002 17:41:17 -0800 (PST) (envelope-from dillon) Date: Sat, 14 Dec 2002 17:41:17 -0800 (PST) From: Matthew Dillon Message-Id: <200212150141.gBF1fHJc060370@apollo.backplane.com> To: "Brian F. Feldman" , Jake Burkholder , "Brian F. Feldman" , John Baldwin , Kris Kennaway , current@FreeBSD.ORG, alpha@FreeBSD.ORG Subject: Re: UMA panic under load References: <200212150121.gBF1L15m014304@green.bikeshed.org> <200212150134.gBF1Yit5060312@apollo.backplane.com> Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Here's another go at a patch (untested). -Matt Index: kern/kern_exit.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exit.c,v retrieving revision 1.187 diff -u -r1.187 kern_exit.c --- kern/kern_exit.c 10 Dec 2002 02:33:44 -0000 1.187 +++ kern/kern_exit.c 15 Dec 2002 01:36:35 -0000 @@ -289,6 +289,7 @@ * may be mapped within that space also. */ if (--vm->vm_refcnt == 0) { + ++vm->vm_exitingcnt; if (vm->vm_shm) shmexit(p); vm_page_lock_queues(); @@ -297,7 +298,6 @@ vm_page_unlock_queues(); (void) vm_map_remove(&vm->vm_map, vm_map_min(&vm->vm_map), vm_map_max(&vm->vm_map)); - vm->vm_freer = p; } sx_xlock(&proctree_lock); Index: vm/vm_map.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_map.c,v retrieving revision 1.273 diff -u -r1.273 vm_map.c --- vm/vm_map.c 1 Dec 2002 18:57:56 -0000 1.273 +++ vm/vm_map.c 15 Dec 2002 01:40:39 -0000 @@ -258,7 +258,7 @@ vm->vm_map.pmap = vmspace_pmap(vm); /* XXX */ vm->vm_refcnt = 1; vm->vm_shm = NULL; - vm->vm_freer = NULL; + vm->vm_exitingcount = 0; return (vm); } @@ -304,7 +304,7 @@ if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); - if (--vm->vm_refcnt == 0) + if (--vm->vm_refcnt == 0 && vm->vm_exitingcount == 0) vmspace_dofree(vm); } @@ -314,9 +314,10 @@ struct vmspace *vm; GIANT_REQUIRED; - if (p == p->p_vmspace->vm_freer) { - vm = p->p_vmspace; - p->p_vmspace = NULL; + vm = p->p_vmspace; + p->p_vmspace = NULL; + if (--vm->vm_exitingcount == 0) { + KASSERT(vm->vm_refcnt == 0, ("vm_refcnt was not 0")); vmspace_dofree(vm); } } Index: vm/vm_map.h =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_map.h,v retrieving revision 1.92 diff -u -r1.92 vm_map.h --- vm/vm_map.h 22 Sep 2002 04:33:43 -0000 1.92 +++ vm/vm_map.h 15 Dec 2002 01:38:29 -0000 @@ -219,7 +219,7 @@ caddr_t vm_daddr; /* (c) user virtual address of data */ caddr_t vm_maxsaddr; /* user VA at max stack growth */ #define vm_endcopy vm_freer - struct proc *vm_freer; /* vm freed on whose behalf */ + int vm_exitingcnt; /* several processes zombied in exit1 */ }; #ifdef _KERNEL To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message