From ae7f84a9a4c211d9285dd608ae190cd91aaa1d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Mon, 27 Aug 2012 13:22:27 +0000 Subject: [PATCH] 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. --- sys/i386/include/param.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index c1e14245b63..b494f35095d 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -122,6 +122,20 @@ #endif #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ +/* + * Ceiling on amount of swblock kva space, can be changed via + * the kern.maxswzone /boot/loader.conf variable. + * + * 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. + */ +#ifndef VM_SWZONE_SIZE_MAX +#define VM_SWZONE_SIZE_MAX (276 * 128 * 1024) +#endif + /* * Ceiling on size of buffer cache (really only effects write queueing, * the VM page cache is not effected), can be changed via