Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 2010 19:56:26 +0530
From:      "C. Jayachandran" <c.jayachandran@gmail.com>
To:        Randall Stewart <rrs@lakerest.net>, Neel Natu <neelnatu@gmail.com>, freebsd-mips@freebsd.org
Subject:   Few more fixes to the new pagetable page allocation code.
Message-ID:  <AANLkTimVM41XCZDN5pFmkr68D21i1JRwKF3m0IFJvYH8@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
The attached changes
(http://people.freebsd.org/~jchandra/for-review/pmap-free-pte-page.diff)
finally seems to get rid of the occasional hangs I saw during testing.

The first part fixes a lock order reversal (in
pmap_remove_pages...pmap_release_pte_page...uma_zfree_arg...kmem_malloc).
 The pmap and pagequeue locks have to be released before calling
uma_zfree().  The second part takes the the pagequeue lock before
changing the page fields of the pte page, I'm not sure this is
necessary.

Please let me know you comments. With these changes, I can get 'make
-j128 buildworld' consistently work on a 32 cpu setup.

Thanks,
JC.

[-- Attachment #2 --]
Index: sys/mips/mips/pmap.c
===================================================================
--- sys/mips/mips/pmap.c	(revision 208589)
+++ sys/mips/mips/pmap.c	(working copy)
@@ -886,8 +886,12 @@
 	/*
 	 * If the page is finally unwired, simply free it.
 	 */
+	atomic_subtract_int(&cnt.v_wire_count, 1);
+	PMAP_UNLOCK(pmap);
+	vm_page_unlock_queues();
 	pmap_release_pte_page(m);
-	atomic_subtract_int(&cnt.v_wire_count, 1);
+	vm_page_lock_queues();
+	PMAP_LOCK(pmap);
 	return (1);
 }
 
@@ -1008,9 +1012,14 @@
 	paddr = MIPS_KSEG0_TO_PHYS(va);
 	m = PHYS_TO_VM_PAGE(paddr);
 	
+	if (!locked)
+		vm_page_lock_queues();
 	m->pindex = index;
 	m->valid = VM_PAGE_BITS_ALL;
 	m->wire_count = 1;
+	if (!locked)
+		vm_page_unlock_queues();
+
 	atomic_add_int(&cnt.v_wire_count, 1);
 	*vap = (vm_offset_t)va;
 	return (m);
help

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