From owner-freebsd-current Sun Nov 10 11: 3:40 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 BABFE37B401; Sun, 10 Nov 2002 11:03:38 -0800 (PST) Received: from cvsup.no.freebsd.org (c2h5oh.idi.ntnu.no [129.241.103.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9966C43E3B; Sun, 10 Nov 2002 11:03:37 -0800 (PST) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from localhost (localhost [127.0.0.1]) by cvsup.no.freebsd.org (8.12.6/8.12.6) with ESMTP id gAAJ3ZBc024460; Sun, 10 Nov 2002 19:03:35 GMT (envelope-from tegge@cvsup.no.freebsd.org) To: qumqats@outel.org Cc: current@FreeBSD.ORG, alfred@FreeBSD.ORG Subject: Re: Panics instead of Hard Locks From: Tor.Egge@cvsup.no.freebsd.org In-Reply-To: <40095464.1036852016@[192.168.1.20]> References: <40095464.1036852016@[192.168.1.20]> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sun_Nov_10_18:59:46_2002_809)--" Content-Transfer-Encoding: 7bit Message-Id: <20021110190335E.tegge@cvsup.no.freebsd.org> Date: Sun, 10 Nov 2002 19:03:35 GMT X-Dispatcher: imput version 20000228(IM140) Lines: 66 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 ----Next_Part(Sun_Nov_10_18:59:46_2002_809)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > > Since going from a SMP to nonSMP kernel the Hard Locks don't > seem to be happening. However I'm getting panics. > > I've gotten 4 'sleeping thread owns a mutex' panics and one each > of 'Assertion i != 0 failed at ../../../kern/subr_witness.c:669' > and 'Duplicate free of item 0xc3895cc0 from zone 0xc0ea63c0(VMSPACE)' The 'Duplicate free' can be caused by a race between swapout_procs() and kern_exit()+wait1(). The enclosed patch might help. Disabling swapping (sysctl vm.swap_enabled=0) can also help. - Tor Egge ----Next_Part(Sun_Nov_10_18:59:46_2002_809)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=foodiff2 Index: sys/kern/kern_exit.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exit.c,v retrieving revision 1.184 diff -u -r1.184 kern_exit.c --- sys/kern/kern_exit.c 15 Oct 2002 00:14:32 -0000 1.184 +++ sys/kern/kern_exit.c 10 Nov 2002 17:58:39 -0000 @@ -285,7 +285,7 @@ * Can't free the entire vmspace as the kernel stack * may be mapped within that space also. */ - if (--vm->vm_refcnt == 0) { + if (vm->vm_refcnt == 1) { if (vm->vm_shm) shmexit(p); pmap_remove_pages(vmspace_pmap(vm), vm_map_min(&vm->vm_map), Index: sys/vm/vm_map.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_map.c,v retrieving revision 1.271 diff -u -r1.271 vm_map.c --- sys/vm/vm_map.c 9 Nov 2002 21:26:49 -0000 1.271 +++ sys/vm/vm_map.c 10 Nov 2002 17:59:40 -0000 @@ -314,11 +317,9 @@ struct vmspace *vm; GIANT_REQUIRED; - if (p == p->p_vmspace->vm_freer) { - vm = p->p_vmspace; - p->p_vmspace = NULL; - vmspace_dofree(vm); - } + vm = p->p_vmspace; + p->p_vmspace = NULL; + vmspace_free(vm); } /* ----Next_Part(Sun_Nov_10_18:59:46_2002_809)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message