Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2008 21:14:30 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
Subject:   svn commit: r185648 - in stable/6/sys: alpha/alpha amd64/amd64 ia64/ia64 powerpc/powerpc sparc64/sparc64
Message-ID:  <200812052114.mB5LEUGm073224@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Dec  5 21:14:30 2008
New Revision: 185648
URL: http://svn.freebsd.org/changeset/base/185648

Log:
  MFC: It has been observed on the mailing lists that the different
  categories of pages don't sum to anywhere near the total number of pages
  on amd64.  This is for the most part because uma_small_alloc() pages have
  never been counted as wired pages, like their kmem_malloc() brethren.  They
  should be.  This changes fixes that.
  
  Discussed with:	alc (a while ago)

Modified:
  stable/6/sys/alpha/alpha/uma_machdep.c
  stable/6/sys/amd64/amd64/uma_machdep.c
  stable/6/sys/ia64/ia64/uma_machdep.c
  stable/6/sys/powerpc/powerpc/uma_machdep.c
  stable/6/sys/sparc64/sparc64/vm_machdep.c

Modified: stable/6/sys/alpha/alpha/uma_machdep.c
==============================================================================
--- stable/6/sys/alpha/alpha/uma_machdep.c	Fri Dec  5 20:50:24 2008	(r185647)
+++ stable/6/sys/alpha/alpha/uma_machdep.c	Fri Dec  5 21:14:30 2008	(r185648)
@@ -49,9 +49,9 @@ uma_small_alloc(uma_zone_t zone, int byt
 
 	*flags = UMA_SLAB_PRIV;
 	if ((wait & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT;
+		pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
 	else
-		pflags = VM_ALLOC_SYSTEM;
+		pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
 	if (wait & M_ZERO)
 		pflags |= VM_ALLOC_ZERO;
 	for (;;) {
@@ -76,7 +76,9 @@ uma_small_free(void *mem, int size, u_in
 	vm_page_t m;
 
 	m = PHYS_TO_VM_PAGE(ALPHA_K0SEG_TO_PHYS((vm_offset_t)mem));
+	m->wire_count--;
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();
+	atomic_subtract_int(&cnt.v_wire_count, 1);
 }

Modified: stable/6/sys/amd64/amd64/uma_machdep.c
==============================================================================
--- stable/6/sys/amd64/amd64/uma_machdep.c	Fri Dec  5 20:50:24 2008	(r185647)
+++ stable/6/sys/amd64/amd64/uma_machdep.c	Fri Dec  5 21:14:30 2008	(r185648)
@@ -50,9 +50,9 @@ uma_small_alloc(uma_zone_t zone, int byt
 
 	*flags = UMA_SLAB_PRIV;
 	if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT;
+		pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
 	else
-		pflags = VM_ALLOC_SYSTEM;
+		pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
 	if (wait & M_ZERO)
 		pflags |= VM_ALLOC_ZERO;
 	for (;;) {
@@ -82,7 +82,9 @@ uma_small_free(void *mem, int size, u_in
 	pa = DMAP_TO_PHYS((vm_offset_t)mem);
 	dump_drop_page(pa);
 	m = PHYS_TO_VM_PAGE(pa);
+	m->wire_count--;
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();
+	atomic_subtract_int(&cnt.v_wire_count, 1);
 }

Modified: stable/6/sys/ia64/ia64/uma_machdep.c
==============================================================================
--- stable/6/sys/ia64/ia64/uma_machdep.c	Fri Dec  5 20:50:24 2008	(r185647)
+++ stable/6/sys/ia64/ia64/uma_machdep.c	Fri Dec  5 21:14:30 2008	(r185648)
@@ -48,9 +48,9 @@ uma_small_alloc(uma_zone_t zone, int byt
 
 	*flags = UMA_SLAB_PRIV;
 	if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT;
+		pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
 	else
-		pflags = VM_ALLOC_SYSTEM;
+		pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
 	if (wait & M_ZERO)
 		pflags |= VM_ALLOC_ZERO;
 
@@ -76,7 +76,9 @@ uma_small_free(void *mem, int size, u_in
 	vm_page_t m;
 
 	m = PHYS_TO_VM_PAGE(IA64_RR_MASK((u_int64_t)mem));
+	m->wire_count--;
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();
+	atomic_subtract_int(&cnt.v_wire_count, 1);
 }

Modified: stable/6/sys/powerpc/powerpc/uma_machdep.c
==============================================================================
--- stable/6/sys/powerpc/powerpc/uma_machdep.c	Fri Dec  5 20:50:24 2008	(r185647)
+++ stable/6/sys/powerpc/powerpc/uma_machdep.c	Fri Dec  5 21:14:30 2008	(r185648)
@@ -54,9 +54,9 @@ uma_small_alloc(uma_zone_t zone, int byt
 
 	*flags = UMA_SLAB_PRIV;
 	if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT;
+		pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
 	else
-		pflags = VM_ALLOC_SYSTEM;
+		pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
 	if (wait & M_ZERO)
 		pflags |= VM_ALLOC_ZERO;
 
@@ -84,8 +84,10 @@ uma_small_free(void *mem, int size, u_in
 	vm_page_t m;
 
 	m = PHYS_TO_VM_PAGE((u_int32_t)mem);
+	m->wire_count--;
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();
+	atomic_subtract_int(&cnt.v_wire_count, 1);
 	atomic_subtract_int(&hw_uma_mdpages, 1);
 }

Modified: stable/6/sys/sparc64/sparc64/vm_machdep.c
==============================================================================
--- stable/6/sys/sparc64/sparc64/vm_machdep.c	Fri Dec  5 20:50:24 2008	(r185647)
+++ stable/6/sys/sparc64/sparc64/vm_machdep.c	Fri Dec  5 21:14:30 2008	(r185648)
@@ -462,9 +462,9 @@ uma_small_alloc(uma_zone_t zone, int byt
 	*flags = UMA_SLAB_PRIV;
 
 	if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT)
-		pflags = VM_ALLOC_INTERRUPT;
+		pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED;
 	else
-		pflags = VM_ALLOC_SYSTEM;
+		pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED;
 
 	if (wait & M_ZERO)
 		pflags |= VM_ALLOC_ZERO;
@@ -501,7 +501,9 @@ uma_small_free(void *mem, int size, u_in
 
 	PMAP_STATS_INC(uma_nsmall_free);
 	m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem));
+	m->wire_count--;
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();
+	atomic_subtract_int(&cnt.v_wire_count, 1);
 }



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