From owner-freebsd-current@FreeBSD.ORG Mon Aug 13 21:23:23 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 1D1D6106566C; Mon, 13 Aug 2012 21:23:23 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 8882D8FC08; Mon, 13 Aug 2012 21:23:21 +0000 (UTC) Received: from server.rulingia.com (c220-239-249-137.belrs5.nsw.optusnet.com.au [220.239.249.137]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q7DLNGgr080582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Aug 2012 07:23:16 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q7DLN9eC074663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Aug 2012 07:23:09 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7DLN9d3074662; Tue, 14 Aug 2012 07:23:09 +1000 (EST) (envelope-from peter) Date: Tue, 14 Aug 2012 07:23:09 +1000 From: Peter Jeremy To: Colin Percival Message-ID: <20120813212309.GA74129@server.rulingia.com> References: <502831B7.1080309@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline In-Reply-To: <502831B7.1080309@freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) 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: Mon, 13 Aug 2012 21:23:23 -0000 --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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). >The current default for VM_SWZONE_SIZE_MAX was set in August 2002 to 32 Mi= B; >meaning that anyone who wants to use more than ~ 3.5 GB of swap space ought >to set kern.maxswzone in /boot/loader.conf. In practice, you can't fully populate each swblock. I did a test on my amd64 box by running multiple copies of a program that allocates and dirties a big chunk of RAM and then pause()s. That gave me a 90% swblock utilisation - which I suspect is higher than a typical scenario where memory pressure pushes more randomly unused pages out. Realistically, I'd say that the default VM_SWZONE_SIZE_MAX can handle about 9GB swap (at least, that was my experience). 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(). --=20 Peter Jeremy --PEIAKu/WMn1b1Hv9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlApcD0ACgkQ/opHv/APuIeGzgCgnHz+eaHudb1YePddap28MTaH S7wAmgKY5TPkNaslUTrh3/3WI03rmkdN =hkWg -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9--