Date: Mon, 20 Jun 2005 12:44:33 +0200 From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) To: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua> Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: cvs commit: src/sys/vm uma_int.h Message-ID: <86y895gve6.fsf@xps.des.no> In-Reply-To: <20050620124020.H21125@atlantis.atlantis.dp.ua> (Dmitry Pryanishnikov's message of "Mon, 20 Jun 2005 12:45:37 %2B0300 (EEST)") References: <20050620124020.H21125@atlantis.atlantis.dp.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Dmitry Pryanishnikov <dmitry@atlantis.dp.ua> writes: > Is it possible to tune this (or ideally, autotune) from the loader (or du= ring > the initialization of the kernel itself)? The attached patch adds a vm.boot_pages tunable and a corresponding read-only sysctl variable. Note that I haven't tested it (except to make sure it compiles). DES --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=boot_pages.diff Index: sys/vm/vm_page.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_page.c,v retrieving revision 1.304 diff -u -r1.304 vm_page.c --- sys/vm/vm_page.c 15 Mar 2005 14:14:09 -0000 1.304 +++ sys/vm/vm_page.c 20 Jun 2005 10:41:07 -0000 @@ -102,9 +102,11 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/lock.h> +#include <sys/kernel.h> #include <sys/malloc.h> #include <sys/mutex.h> #include <sys/proc.h> +#include <sys/sysctl.h> #include <sys/vmmeter.h> #include <sys/vnode.h> @@ -132,6 +134,11 @@ long first_page = 0; int vm_page_zero_count = 0; +static int boot_pages = UMA_BOOT_PAGES; +TUNABLE_INT("vm.boot_pages", &boot_pages); +SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, + "number of pages allocated for bootstrapping the VM system"); + /* * vm_set_page_size: * @@ -175,7 +182,6 @@ int biggestone; vm_paddr_t total; - vm_size_t bootpages; total = 0; biggestsize = 0; @@ -219,8 +225,7 @@ * Allocate memory for use when boot strapping the kernel memory * allocator. */ - bootpages = UMA_BOOT_PAGES * UMA_SLAB_SIZE; - new_end = end - bootpages; + new_end = end - (boot_pages * UMA_SLAB_SIZE); new_end = trunc_page(new_end); mapped = pmap_map(&vaddr, new_end, end, VM_PROT_READ | VM_PROT_WRITE); --=-=-=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y895gve6.fsf>