From owner-freebsd-arch@FreeBSD.ORG Mon Jul 26 17:05:07 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461D61065672 for ; Mon, 26 Jul 2010 17:05:07 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 16E9D8FC12 for ; Mon, 26 Jul 2010 17:05:07 +0000 (UTC) Received: by pxi8 with SMTP id 8so173798pxi.13 for ; Mon, 26 Jul 2010 10:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=EqN/H7CaSAZ1SzK6adoTVXNoG0x2DfVCKIoz6sAPAvQ=; b=CMFkHLTt/pPXUDPyfS5cunKeBzbaGvP9iLz2KCNWveO7v/SP7R1RAaEJn/0ufzgIsV Ps/t0BdpTpYcGDeLKIYYFHwOxM6bMW+HBkL6E5WyUf4jATg+Qur28gTNlHyS+XOt0HcY SJc7iXMJtXa8jUXxnJX4aQb5xcbwfeeSsA5t0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=FhwqqqKnYM5tSPaV4IteFi45jtluziDyOwkFiAdTFRggPaq4pCIKE7oY6r/TK/K/Ca xZNe34hfPyQXO0B895WksIfIAMD7YYqcC79+FN/hBhILs6bKooYKMrDyRzL73gqlrUr1 T+Xywd7yPMynxoIMJAmmGhCG+/ffibhRUK2gE= MIME-Version: 1.0 Received: by 10.114.103.9 with SMTP id a9mr11787324wac.174.1280163898288; Mon, 26 Jul 2010 10:04:58 -0700 (PDT) Received: by 10.42.6.85 with HTTP; Mon, 26 Jul 2010 10:04:58 -0700 (PDT) In-Reply-To: <4C4DB2B8.9080404@freebsd.org> References: <4C4DB2B8.9080404@freebsd.org> Date: Mon, 26 Jul 2010 10:04:58 -0700 Message-ID: From: Matthew Fleming To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-arch@freebsd.org Subject: Re: amd64: change VM_KMEM_SIZE_SCALE to 1? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2010 17:05:07 -0000 On Mon, Jul 26, 2010 at 9:07 AM, Andriy Gapon wrote: > > Anyone knows any reason why VM_KMEM_SIZE_SCALE on amd64 should not be set to 1? > I mean things potentially breaking, or some unpleasant surprise for an > administrator/user... As I understand it, it's merely a resource usage issue. amd64 needs page table entries for the expected virtual address space, so allowing more than e.g. 1/3 of physical memory means needing more PTEs. But the memory overhead isn't all that large IIRC: each 4k physical memory devoted to PTEs maps 512 4k virtual addresses, or 2MB, so e.g. it takes about 4MB reserved as PTE pages to map 2GB of kernel virtual address space. Having cut my OS teeth on AIX/PowerPC where virutal address space is free and has no relation to the size of the hardware page table, the FreeBSD architecture limiting the size of the kernel virtual space seemed weird to me. However, since FreeBSD also does not page kernel data to disk, there's a good reason to limit the size of the kernel's virtual space, since that also limits the kernel's physical space. In other words, setting it to 1 could lead to the system being out of memory but not trying to fail kernel malloc requests. I'm not entirely sure this is a new problem since one could also chew through physical memory with sub-page uma allocations as well on amd64. Corrections to the above gratefully accepted. This is just my current understanding of it. Thanks, matthew