Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2002 19:03:35 GMT
From:      Tor.Egge@cvsup.no.freebsd.org
To:        qumqats@outel.org
Cc:        current@FreeBSD.ORG, alfred@FreeBSD.ORG
Subject:   Re: Panics instead of Hard Locks
Message-ID:  <20021110190335E.tegge@cvsup.no.freebsd.org>
In-Reply-To: <40095464.1036852016@[192.168.1.20]>
References:  <40095464.1036852016@[192.168.1.20]>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021110190335E.tegge>