From owner-freebsd-arch@FreeBSD.ORG Thu Jan 31 08:32:14 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EA2C10A; Thu, 31 Jan 2013 08:32:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A8ECD290; Thu, 31 Jan 2013 08:32:13 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA05436; Thu, 31 Jan 2013 10:32:12 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1U0pZ5-000PCy-Mm; Thu, 31 Jan 2013 10:32:11 +0200 Message-ID: <510A2C09.6030709@FreeBSD.org> Date: Thu, 31 Jan 2013 10:32:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130121 Thunderbird/17.0.2 MIME-Version: 1.0 To: alc@FreeBSD.org Subject: Re: kva size on amd64 References: <507E7E59.8060201@FreeBSD.org> <51098743.2050603@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alan Cox , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 08:32:14 -0000 on 31/01/2013 10:10 Alan Cox said the following: > In short, it will waste a non-trivial amount of physical memory. Unlike user > virtual address spaces, page table pages are preallocated for the kernel virtual > address space. More precisely, they are preallocated for the reserved (or > defined) regions of the kernel map, i.e., every range of addresses that has a > corresponding vm_map_entry. The kmem map is one such reserved region. So, if > you always set your kmem map to its maximum possible size of ~300GB, then you > are preallocating about 600MB of physical memory for page table pages that will > never be used (except on machines with 300+ GB of DRAM). Alan, thank you very much for this information! Would it make sense then to do either of the following: - add some (non-trivial) code to auto-grow kmem map upon kva shortage - set default vm_kmem_size to min(2 * mem_size, vm_kmem_size_max) ? Perhaps something else?.. BTW, it seems that in OpenSolaris they do not limit kva size, but probably they allocate kernel page tables in some different way (on demand perhaps). -- Andriy Gapon