From owner-freebsd-current@FreeBSD.ORG Sat Aug 18 11:01:46 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 5C61E106564A; Sat, 18 Aug 2012 11:01:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 30E268FC0A; Sat, 18 Aug 2012 11:01:46 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 910C7B95B; Sat, 18 Aug 2012 07:01:45 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 14 Aug 2012 13:46:12 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <502831B7.1080309@freebsd.org> <86zk5y55rg.fsf@ds4.des.no> In-Reply-To: <86zk5y55rg.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201208141346.12782.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 18 Aug 2012 07:01:45 -0400 (EDT) Cc: alc@freebsd.org, Dag-Erling =?iso-8859-15?q?Sm=F8rgrav?= , Colin Percival 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: Sat, 18 Aug 2012 11:01:46 -0000 On Tuesday, August 14, 2012 02:47:47 AM Dag-Erling Sm=F8rgrav wrote: > Colin Percival writes: > > 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. >=20 > Far less, in fact. As mentioned in loader(8), the default 32 MB limit > is enough for slightly more than 7 GB of swap space - assuming 100% > efficient use of swblocks. The man page recommends not using more than > half the theoretical limit, or, with 16 pages per swblock, >=20 > 1 maxswzone x s > --- x --------------- > 2 16 >=20 > where s =3D 276 on 32-bit systems and 288 on 64-bit systems. >=20 > > The current default for VM_SWZONE_SIZE_MAX was set in August 2002 to 32 > > MiB; meaning that anyone who wants to use more than ~ 3.5 GB of swap > > space ought to set kern.maxswzone in /boot/loader.conf. > >=20 > > Is it time to increase this default on amd64? (I understand that keepi= ng > > the value low on i386 is important due to KVA limitations, but amd64 has > > far more address space available...) >=20 > There is no reason to keep this limit at all. The algorithm used to > size the zone is "physpages / 2 * sizeof(struct swblock) or maxswzone, > whichever is smaller" where maxswzone =3D=3D VM_SWZONE_SIZE_MAX unless > kern.maxswzone was set in loader.conf. On amd64, the cutoff point is > slightly below 1 GB of physical memory (233,016 4,096-byte pages), so > the limit doesn't help machines that actually need to conserve memory, > and it hurts machines that have plenty of it and therefore also plenty > of swap (assuming the user followed the old "twice the amount of RAM" > rule of thumb). Hmm, this is not true on i386 where the problem is not just the physical RAM required, but also address space. (The swap zone is all mapped into KV= A=20 even if it isn't used.) This is why Alan's e-mail specifically mentioned amd64, ia64, etc. but not i386 in his list. I think i386 still needs this limit, and I think your commit jumped the gun a bit. =2D-=20 John Baldwin