From 2cf36c8f6790af9b84cf3cda0f7ef0755457abd9 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 10 Nov 2010 17:57:34 +0000 Subject: [PATCH] Enable reservation-based physical memory allocation. Even without the creation of large page mappings in the pmap, it can provide modest performance benefits. In particular, for a "buildworld" on a 2x 1GHz Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system time by 12.6%. Tested by: marius@ --- sys/sparc64/include/vmparam.h | 11 +++++++++-- sys/vm/vm_reserv.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h index b9ce5466315..b92312efc0b 100644 --- a/sys/sparc64/include/vmparam.h +++ b/sys/sparc64/include/vmparam.h @@ -128,10 +128,17 @@ #endif /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL -#define VM_NRESERVLEVEL 0 +#define VM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 512 pages. + */ +#ifndef VM_LEVEL_0_ORDER +#define VM_LEVEL_0_ORDER 9 #endif /* diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index 423bb3115af..f5f44f7d281 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -194,7 +194,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS) } mtx_unlock(&vm_page_queue_free_mtx); sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, - unused_pages * (PAGE_SIZE / 1024), counter); + unused_pages * ((int)PAGE_SIZE / 1024), counter); } error = sbuf_finish(&sbuf); sbuf_delete(&sbuf);