From owner-freebsd-current@FreeBSD.ORG Tue Aug 14 08:45:22 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2DE8106564A for ; Tue, 14 Aug 2012 08:45:21 +0000 (UTC) (envelope-from bounces+73574-dfb6-freebsd-current=freebsd.org@sendgrid.me) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) by mx1.freebsd.org (Postfix) with SMTP id 796E48FC1D for ; Tue, 14 Aug 2012 08:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=n2JBp3kEKUWk3Pws1hUNCquXbBE=; b=ZSjNaF6+6AjzvVuYxWplE3wS+Pue SMV3/hshDBAHsKn5EsSHUpLpPVu0Vki/Bz5ORnTzg08qZnz0wumvx+EMLiW3EOXz 6NIsrs1iICEwjZ9we1qQ5EEeT75gw33RhevyxtFL87dL0CO9ADPW0urZ1zUN/XWo E38d4y4beZOF3kU= Received: by 10.4.35.242 with SMTP id mf70.11780.502A101E4 Tue, 14 Aug 2012 03:45:18 -0500 (CDT) Received: from mail.tarsnap.com (unknown [10.9.180.5]) by mi12 (SG) with ESMTP id 502a101e.7f3c.a3a705 for ; Tue, 14 Aug 2012 03:45:18 -0500 (CST) Received: (qmail 57879 invoked from network); 14 Aug 2012 08:41:08 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 14 Aug 2012 08:41:08 -0000 Received: (qmail 36104 invoked from network); 14 Aug 2012 08:45:14 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 14 Aug 2012 08:45:14 -0000 Message-ID: <502A101A.7050909@freebsd.org> Date: Tue, 14 Aug 2012 01:45:14 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120731 Thunderbird/14.0 MIME-Version: 1.0 To: Peter Jeremy References: <502831B7.1080309@freebsd.org> <20120813212309.GA74129@server.rulingia.com> In-Reply-To: <20120813212309.GA74129@server.rulingia.com> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: XhyBwObMhraAR+zdwMupjQ6BIqbhdEfc+6p+uBxS7S83AqeZPK7rhQV+3rOcUVnQ2EinrtZjQY2biFlvrJ8xx4XOrWtTrT/cX1XCkqEQoaPOlm4P6V8L6vxZVgwBNH/VOlG3DbV/4DYfKP2NDcnqZpWU/RyWuu+vOcesZaiwwdw= Cc: FreeBSD current Subject: Re: Time to bump default VM_SWZONE_SIZE_MAX? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2012 08:45:22 -0000 On 08/13/12 14:23, Peter Jeremy wrote: > On 2012-Aug-12 15:44:07 -0700, Colin Percival > wrote: >> If I'm understanding things correctly, the "maxswzone" value -- set by >> the kern.maxswzone loader tunable or to VM_SWZONE_SIZE_MAX by default -- >> should be approximately 9 MiB per GiB of swap space. > > I'm not sure how you got that value. By default, struct swblock is 288 > bytes (280 bytes on 32-bit archs) and can store up to 32 pages of swap (the > comment in vm/swap_pager.c:swap_pager_swap_init() is wrong). For x86, this > is 2.25 MiB per GiB (best case). I got that value from a previous mailing list discussion -- I think it was based on the (incorrect) value of 16 pages per swblock and not exceeding 50% swblock utilization. > Realistically, I'd say that the default VM_SWZONE_SIZE_MAX can handle about > 9GB swap (at least, that was my experience). The 50% utilization rule of thumb would make it 7 GB, but yes, same order of magnitude. > BTW, if you plan on allocating lots of swap, be aware that each swap device > is limited to 32GiB - see vm/swap_pager.c:swaponsomething(). Yes, noted. I'm not actually using lots of swap myself, but I was writing code for EC2 instances to set up "reasonable" amounts of swap at boot time, and I don't want to accidentally autoconfigure more swap than FreeBSD can safely use. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid