From owner-cvs-src@FreeBSD.ORG Mon Jun 20 10:44:39 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.ORG Delivered-To: cvs-src@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D302916A41C; Mon, 20 Jun 2005 10:44:39 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80AA343D53; Mon, 20 Jun 2005 10:44:39 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 66E8160FA; Mon, 20 Jun 2005 12:44:33 +0200 (CEST) Received: from xps.des.no (des.no [80.203.228.37]) by tim.des.no (Postfix) with ESMTP id 4F34660F7; Mon, 20 Jun 2005 12:44:33 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 2455333C52; Mon, 20 Jun 2005 12:44:33 +0200 (CEST) To: Dmitry Pryanishnikov References: <20050620124020.H21125@atlantis.atlantis.dp.ua> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Mon, 20 Jun 2005 12:44:33 +0200 In-Reply-To: <20050620124020.H21125@atlantis.atlantis.dp.ua> (Dmitry Pryanishnikov's message of "Mon, 20 Jun 2005 12:45:37 +0300 (EEST)") Message-ID: <86y895gve6.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Learn: ham X-Spam-Score: -5.2/5.0 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on tim.des.no Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: cvs commit: src/sys/vm uma_int.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2005 10:44:40 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Dmitry Pryanishnikov 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 #include #include +#include #include #include #include +#include #include #include @@ -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); --=-=-=--