Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2013 17:53:40 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r249707 - in user/attilio/jeff-numa/sys: amd64/include arm/include conf i386/include ia64/include mips/include powerpc/include sparc64/include vm x86/acpica
Message-ID:  <201304201753.r3KHre7p084211@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sat Apr 20 17:53:39 2013
New Revision: 249707
URL: http://svnweb.freebsd.org/changeset/base/249707

Log:
  Retire VM_NDOMAIN macro and introduce MAXDOMAIN concept which is very
  similar to what MAXCPUS do for CPUs.
  The value can be still compiled in from custom kernel option files, just
  like MAXCPUS and VM_NDOMAIN.
  The standard values for VM_NDOMAIN are currently retained.
  
  Sponsored by:	EMC / Isilon storage division
  Obtained from:	jeff

Modified:
  user/attilio/jeff-numa/sys/amd64/include/param.h
  user/attilio/jeff-numa/sys/amd64/include/vmparam.h
  user/attilio/jeff-numa/sys/arm/include/param.h
  user/attilio/jeff-numa/sys/arm/include/vmparam.h
  user/attilio/jeff-numa/sys/conf/NOTES
  user/attilio/jeff-numa/sys/conf/options
  user/attilio/jeff-numa/sys/i386/include/param.h
  user/attilio/jeff-numa/sys/i386/include/vmparam.h
  user/attilio/jeff-numa/sys/ia64/include/param.h
  user/attilio/jeff-numa/sys/ia64/include/vmparam.h
  user/attilio/jeff-numa/sys/mips/include/param.h
  user/attilio/jeff-numa/sys/mips/include/vmparam.h
  user/attilio/jeff-numa/sys/powerpc/include/param.h
  user/attilio/jeff-numa/sys/powerpc/include/vmparam.h
  user/attilio/jeff-numa/sys/sparc64/include/param.h
  user/attilio/jeff-numa/sys/sparc64/include/vmparam.h
  user/attilio/jeff-numa/sys/vm/vm_phys.c
  user/attilio/jeff-numa/sys/x86/acpica/srat.c

Modified: user/attilio/jeff-numa/sys/amd64/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/amd64/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/amd64/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -71,6 +71,10 @@
 #define MAXCPU		1
 #endif
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 #define	ALIGNBYTES		_ALIGNBYTES
 #define	ALIGN(p)		_ALIGN(p)
 /*

Modified: user/attilio/jeff-numa/sys/amd64/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/amd64/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/amd64/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -121,13 +121,6 @@
 #define	VM_NFREEORDER		13
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Enable superpage reservations: 1 level.
  */
 #ifndef	VM_NRESERVLEVEL

Modified: user/attilio/jeff-numa/sys/arm/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/arm/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/arm/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -80,6 +80,10 @@
 #define	MAXCPU		1
 #endif /* SMP || KLD_MODULE */
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 #define	ALIGNBYTES	_ALIGNBYTES
 #define	ALIGN(p)	_ALIGN(p)
 /*

Modified: user/attilio/jeff-numa/sys/arm/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/arm/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/arm/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -109,13 +109,6 @@
 #define	VM_NFREEORDER		9
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Disable superpage reservations.
  */
 #ifndef	VM_NRESERVLEVEL

Modified: user/attilio/jeff-numa/sys/conf/NOTES
==============================================================================
--- user/attilio/jeff-numa/sys/conf/NOTES	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/conf/NOTES	Sat Apr 20 17:53:39 2013	(r249707)
@@ -224,6 +224,10 @@ options 	SMP			# Symmetric MultiProcesso
 # A default value should be already present, for every architecture.
 options 	MAXCPU=32
 
+# MAXDOMAIN defines the maximum number of memory domains that can boot in the
+# system.  A default value should be already present, for every architecture.
+options 	MAXDOMAIN=1
+
 # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin
 # if the thread that currently owns the mutex is executing on another
 # CPU.  This behavior is enabled by default, so this option can be used

Modified: user/attilio/jeff-numa/sys/conf/options
==============================================================================
--- user/attilio/jeff-numa/sys/conf/options	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/conf/options	Sat Apr 20 17:53:39 2013	(r249707)
@@ -568,6 +568,7 @@ DIAGNOSTIC		opt_global.h
 INVARIANT_SUPPORT	opt_global.h
 INVARIANTS		opt_global.h
 MAXCPU			opt_global.h
+MAXDOMAIN		opt_global.h
 MAXPHYS			opt_global.h
 MCLSHIFT		opt_global.h
 MUTEX_DEBUG		opt_global.h
@@ -584,7 +585,6 @@ VFS_BIO_DEBUG		opt_global.h
 VM_KMEM_SIZE		opt_vm.h
 VM_KMEM_SIZE_SCALE	opt_vm.h
 VM_KMEM_SIZE_MAX	opt_vm.h
-VM_NDOMAIN		opt_vm.h
 VM_NRESERVLEVEL		opt_vm.h
 VM_LEVEL_0_ORDER	opt_vm.h
 NO_SWAPPING		opt_vm.h

Modified: user/attilio/jeff-numa/sys/i386/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/i386/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/i386/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -75,6 +75,10 @@
 #define MAXCPU		1
 #endif /* SMP || KLD_MODULE */
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 #define ALIGNBYTES	_ALIGNBYTES
 #define ALIGN(p)	_ALIGN(p)
 /*

Modified: user/attilio/jeff-numa/sys/i386/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/i386/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/i386/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -107,13 +107,6 @@
 #endif
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Enable superpage reservations: 1 level.
  */
 #ifndef	VM_NRESERVLEVEL

Modified: user/attilio/jeff-numa/sys/ia64/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/ia64/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/ia64/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -69,6 +69,10 @@
 #define MAXCPU		1
 #endif
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 #define	ALIGNBYTES		_ALIGNBYTES
 #define	ALIGN(p)		_ALIGN(p)
 /*

Modified: user/attilio/jeff-numa/sys/ia64/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/ia64/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/ia64/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -103,13 +103,6 @@
 #define	VM_NFREEORDER		16
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Disable superpage reservations.
  */
 #ifndef	VM_NRESERVLEVEL

Modified: user/attilio/jeff-numa/sys/mips/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/mips/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/mips/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -101,6 +101,10 @@
 #define	MAXCPU		1
 #endif
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 /*
  * Round p (pointer or byte index) up to a correctly-aligned value for all
  * data types (int, long, ...).	  The result is u_int and must be cast to

Modified: user/attilio/jeff-numa/sys/mips/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/mips/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/mips/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -101,13 +101,6 @@
 #endif
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Disable superpage reservations. (not sure if this is right
  * I copied it from ARM)
  */

Modified: user/attilio/jeff-numa/sys/powerpc/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/powerpc/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/powerpc/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -75,6 +75,10 @@
 #define	MAXCPU		1
 #endif /* SMP || KLD_MODULE */
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 #define	ALIGNBYTES	_ALIGNBYTES
 #define	ALIGN(p)	_ALIGN(p)
 /*

Modified: user/attilio/jeff-numa/sys/powerpc/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/powerpc/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/powerpc/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -163,13 +163,6 @@ struct pmap_physseg {
 #define	VM_NFREEORDER		11
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Disable superpage reservations.
  */
 #ifndef	VM_NRESERVLEVEL

Modified: user/attilio/jeff-numa/sys/sparc64/include/param.h
==============================================================================
--- user/attilio/jeff-numa/sys/sparc64/include/param.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/sparc64/include/param.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -57,6 +57,10 @@
 #define MAXCPU		1
 #endif /* SMP || KLD_MODULE */
 
+#ifndef MAXDOMAIN
+#define	MAXDOMAIN	1
+#endif
+
 #define	INT_SHIFT	2
 #define	PTR_SHIFT	3
 

Modified: user/attilio/jeff-numa/sys/sparc64/include/vmparam.h
==============================================================================
--- user/attilio/jeff-numa/sys/sparc64/include/vmparam.h	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/sparc64/include/vmparam.h	Sat Apr 20 17:53:39 2013	(r249707)
@@ -106,13 +106,6 @@
 #define	VM_NFREEORDER		12
 
 /*
- * Only one memory domain.
- */
-#ifndef VM_NDOMAIN
-#define	VM_NDOMAIN		1
-#endif
-
-/*
  * Enable superpage reservations: 1 level.
  */
 #ifndef	VM_NRESERVLEVEL

Modified: user/attilio/jeff-numa/sys/vm/vm_phys.c
==============================================================================
--- user/attilio/jeff-numa/sys/vm/vm_phys.c	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/vm/vm_phys.c	Sat Apr 20 17:53:39 2013	(r249707)
@@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_phys.h>
 
 /*
- * VM_FREELIST_DEFAULT is split into VM_NDOMAIN lists, one for each
+ * VM_FREELIST_DEFAULT is split into MAXDOMAIN lists, one for each
  * domain.  These extra lists are stored at the end of the regular
  * free lists starting with VM_NFREELIST.
  */
-#define VM_RAW_NFREELIST	(VM_NFREELIST + VM_NDOMAIN - 1)
+#define VM_RAW_NFREELIST	(VM_NFREELIST + MAXDOMAIN - 1)
 
 struct vm_freelist {
 	struct pglist pl;
@@ -100,7 +100,7 @@ MALLOC_DEFINE(M_FICT_PAGES, "", "");
 static struct vm_freelist
     vm_phys_free_queues[VM_RAW_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER];
 static struct vm_freelist
-(*vm_phys_lookup_lists[VM_NDOMAIN][VM_RAW_NFREELIST])[VM_NFREEPOOL][VM_NFREEORDER];
+(*vm_phys_lookup_lists[MAXDOMAIN][VM_RAW_NFREELIST])[VM_NFREEPOOL][VM_NFREEORDER];
 
 static int vm_nfreelists = VM_FREELIST_DEFAULT + 1;
 
@@ -116,7 +116,7 @@ static int sysctl_vm_phys_segs(SYSCTL_HA
 SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD,
     NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info");
 
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 static int sysctl_vm_phys_lookup_lists(SYSCTL_HANDLER_ARGS);
 SYSCTL_OID(_vm, OID_AUTO, phys_lookup_lists, CTLTYPE_STRING | CTLFLAG_RD,
     NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists");
@@ -198,7 +198,7 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS)
 	return (error);
 }
 
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 /*
  * Outputs the set of free list lookup lists.
  */
@@ -253,7 +253,7 @@ _vm_phys_create_seg(vm_paddr_t start, vm
 #else
 	seg->first_page = PHYS_TO_VM_PAGE(start);
 #endif
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 	if (flind == VM_FREELIST_DEFAULT && domain != 0) {
 		flind = VM_NFREELIST + (domain - 1);
 		if (flind >= vm_nfreelists)
@@ -300,7 +300,7 @@ vm_phys_init(void)
 {
 	struct vm_freelist *fl;
 	int flind, i, oind, pind;
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 	int ndomains, j;
 #endif
 
@@ -345,7 +345,7 @@ vm_phys_init(void)
 				TAILQ_INIT(&fl[oind].pl);
 		}
 	}
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 	/*
 	 * Build a free list lookup list for each domain.  All of the
 	 * memory domain lists are inserted at the VM_FREELIST_DEFAULT
@@ -464,7 +464,7 @@ vm_phys_alloc_freelist_pages(int flind, 
 	KASSERT(order < VM_NFREEORDER,
 	    ("vm_phys_alloc_freelist_pages: order %d is out of range", order));
 
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 	domain = PCPU_GET(domain);
 #else
 	domain = 0;
@@ -883,7 +883,7 @@ vm_phys_alloc_contig(u_long npages, vm_p
 	int domain, flind, oind, order, pind;
 
 	mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 	domain = PCPU_GET(domain);
 #else
 	domain = 0;

Modified: user/attilio/jeff-numa/sys/x86/acpica/srat.c
==============================================================================
--- user/attilio/jeff-numa/sys/x86/acpica/srat.c	Sat Apr 20 17:43:22 2013	(r249706)
+++ user/attilio/jeff-numa/sys/x86/acpica/srat.c	Sat Apr 20 17:53:39 2013	(r249707)
@@ -28,8 +28,6 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include "opt_vm.h"
-
 #include <sys/param.h>
 #include <sys/bus.h>
 #include <sys/kernel.h>
@@ -47,7 +45,7 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/acpica/acpivar.h>
 
-#if VM_NDOMAIN > 1
+#if MAXDOMAIN > 1
 struct cpu_info {
 	int enabled:1;
 	int has_memory:1;
@@ -265,7 +263,7 @@ renumber_domains(void)
 			domains[j] = domains[j - 1];
 		domains[slot] = mem_info[i].domain;
 		ndomain++;
-		if (ndomain > VM_NDOMAIN) {
+		if (ndomain > MAXDOMAIN) {
 			printf("SRAT: Too many memory domains\n");
 			return (EFBIG);
 		}
@@ -362,4 +360,4 @@ srat_set_cpus(void *dummy)
 	}
 }
 SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
-#endif /* VM_NDOMAIN > 1 */
+#endif /* MAXDOMAIN > 1 */



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