svn commit: r324600 - head/sys/vm

Konstantin Belousov kib at FreeBSD.org
Fri Oct 13 16:23:06 UTC 2017


Author: kib
Date: Fri Oct 13 16:23:05 2017
New Revision: 324600
URL: https://svnweb.freebsd.org/changeset/base/324600

Log:
  Evaluate the real size of the sblk_zone.
  
  Submitted by:	ota at j.email.ne.jp
  PR:	221356
  Reviewed by:	alc, markj
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D12660

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Fri Oct 13 15:16:57 2017	(r324599)
+++ head/sys/vm/swap_pager.c	Fri Oct 13 16:23:05 2017	(r324600)
@@ -541,6 +541,14 @@ swap_pager_swap_init(void)
 		 */
 		n -= ((n + 2) / 3);
 	} while (n > 0);
+
+	/*
+	 * Often uma_zone_reserve_kva() cannot reserve exactly the
+	 * requested size.  Account for the difference when
+	 * calculating swap_maxpages.
+	 */
+	n = uma_zone_get_max(swblk_zone);
+
 	if (n2 != n)
 		printf("Swap blk zone entries reduced from %lu to %lu.\n",
 		    n2, n);


More information about the svn-src-head mailing list