From b8e7fc24fe7ebc11bf82aa8c7421c3f53a4522dd Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 27 Dec 2007 16:45:39 +0000 Subject: [PATCH] Add configuration knobs for the superpage reservation system. Initially, the reservation will only be enabled on amd64. --- sys/amd64/include/vmparam.h | 14 ++++++++++++++ sys/arm/include/vmparam.h | 7 +++++++ sys/conf/options | 2 ++ sys/i386/include/vmparam.h | 19 +++++++++++++++++++ sys/ia64/include/vmparam.h | 7 +++++++ sys/powerpc/include/vmparam.h | 7 +++++++ sys/sparc64/include/vmparam.h | 7 +++++++ sys/sun4v/include/vmparam.h | 7 +++++++ 8 files changed, 70 insertions(+) diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 50962e5d0385..712b54b8f283 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -131,6 +131,20 @@ */ #define VM_NFREEORDER 13 +/* + * Enable superpage reservations: 1 level. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 512 pages. + */ +#ifndef VM_LEVEL_0_ORDER +#define VM_LEVEL_0_ORDER 9 +#endif + /* * Virtual addresses of things. Derived from the page directory and * page table indexes from pmap.h for precision. diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h index 35b8d41954c5..a3d84252d01a 100644 --- a/sys/arm/include/vmparam.h +++ b/sys/arm/include/vmparam.h @@ -85,6 +85,13 @@ */ #define VM_NFREEORDER 9 +/* + * Disable superpage reservations. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 0 +#endif + #define UPT_MAX_ADDRESS VADDR(UPTPTDI + 3, 0) #define UPT_MIN_ADDRESS VADDR(UPTPTDI, 0) diff --git a/sys/conf/options b/sys/conf/options index e76c61eb4dea..ea316454abc8 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -551,6 +551,8 @@ 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_NRESERVLEVEL opt_vm.h +VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPING opt_vm.h MALLOC_MAKE_FAILURES opt_vm.h MALLOC_PROFILE opt_vm.h diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h index 2aa2848a1100..6ab27cc9c4ab 100644 --- a/sys/i386/include/vmparam.h +++ b/sys/i386/include/vmparam.h @@ -122,6 +122,25 @@ #define VM_NFREEORDER 11 #endif +/* + * Disable superpage reservations. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 0 +#endif + +/* + * Level 0 reservations consist of 512 pages under PAE and 1024 pages + * otherwise. + */ +#ifndef VM_LEVEL_0_ORDER +#ifdef PAE +#define VM_LEVEL_0_ORDER 9 +#else +#define VM_LEVEL_0_ORDER 10 +#endif +#endif + /* * Kernel physical load address. */ diff --git a/sys/ia64/include/vmparam.h b/sys/ia64/include/vmparam.h index c7dac2c8e3d3..44ae5d8cb658 100644 --- a/sys/ia64/include/vmparam.h +++ b/sys/ia64/include/vmparam.h @@ -144,6 +144,13 @@ */ #define VM_NFREEORDER 16 +/* + * Disable superpage reservations. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 0 +#endif + /* * Manipulating region bits of an address. */ diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h index 0f8298e05c55..212624f984c9 100644 --- a/sys/powerpc/include/vmparam.h +++ b/sys/powerpc/include/vmparam.h @@ -131,6 +131,13 @@ struct pmap_physseg { */ #define VM_NFREEORDER 11 +/* + * Disable superpage reservations. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 0 +#endif + #ifndef VM_INITIAL_PAGEIN #define VM_INITIAL_PAGEIN 16 #endif diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h index 5609e8e9ec11..0f1f37a92bed 100644 --- a/sys/sparc64/include/vmparam.h +++ b/sys/sparc64/include/vmparam.h @@ -121,6 +121,13 @@ */ #define VM_NFREEORDER 12 +/* + * Disable superpage reservations. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 0 +#endif + /* * Address space layout. * diff --git a/sys/sun4v/include/vmparam.h b/sys/sun4v/include/vmparam.h index a994401eb33a..61d4937f9b2e 100644 --- a/sys/sun4v/include/vmparam.h +++ b/sys/sun4v/include/vmparam.h @@ -121,6 +121,13 @@ */ #define VM_NFREEORDER 12 +/* + * Disable superpage reservations. + */ +#ifndef VM_NRESERVLEVEL +#define VM_NRESERVLEVEL 0 +#endif + /* * Address space layout. *