svn commit: r239730 - head/sys/i386/include

David O'Brien obrien at FreeBSD.org
Tue Aug 28 18:16:09 UTC 2012


On Mon, Aug 27, 2012 at 01:22:28PM +0000, Dag-Erling Smrgrav wrote:
> Author: des
> Date: Mon Aug 27 13:22:27 2012
> New Revision: 239730
> URL: http://svn.freebsd.org/changeset/base/239730
>
> Log:
>   Parly revert r239255: reinstate a default maxswzone on i386, where KVA is
>   scarce, but set it slightly higher so we can handle 8 GB of swap.

Thank you for dealing with this issue.  I had a diff addressing this
I had prepared but had yet to send to alc for review.

The comment below says to me the target swap size is 16GB, not 8GB.
>From recent 10-CURRENT experience where I hit the VM_SWZONE_SIZE_MAX
limit many times I think shooting for 16GB is more realistic with today's
desktop application mix.  Or at least 12GB if KVA usage for supporting
16GB is a concern.

All it took to hit this was a 2GB tmpfs and running two web browsers with
many tabs open.

> + * 276 is sizeof(struct swblock), but we do not always have a definition
> + * in scope for struct swblock, so we have to hardcode it.  Each struct
> + * swblock holds metadata for 32 pages, so in theory, this is enough for
> + * 16 GB of swap.  In practice, however, the usable amount is considerably
> + * lower due to fragmentation.

The old definition from r102738 (dillon 2002-08-31) was "32 * 1024 * 1024"
or 32MB.  This allowed for 7GB of swap from a 16GB swap partition, per
top(8)'s "Swap total" reporting of swap usage when I would get
  kernel: swap zone exhausted, increase kern.maxswzone
  kernel: pid 81073 (firefox-bin), uid 1765, was killed: out of swap space
every couple of days.


> +#define VM_SWZONE_SIZE_MAX	(276 * 128 * 1024)

Will 34.5MB, really allow 16GB swap?  On the machine you tested this on,
what did top(8) report when the swap partition was say 20GB?

thanks,
--
-- David  (obrien at FreeBSD.org)


More information about the svn-src-all mailing list