svn commit: r324796 - stable/11/sys/vm

Konstantin Belousov kib at FreeBSD.org
Fri Oct 20 09:21:38 UTC 2017


Author: kib
Date: Fri Oct 20 09:21:37 2017
New Revision: 324796
URL: https://svnweb.freebsd.org/changeset/base/324796

Log:
  MFC r324600, r324716:
  Evaluate the real size of the sblk_zone.

Modified:
  stable/11/sys/vm/swap_pager.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/swap_pager.c
==============================================================================
--- stable/11/sys/vm/swap_pager.c	Fri Oct 20 09:10:49 2017	(r324795)
+++ stable/11/sys/vm/swap_pager.c	Fri Oct 20 09:21:37 2017	(r324796)
@@ -540,7 +540,15 @@ swap_pager_swap_init(void)
 		 */
 		n -= ((n + 2) / 3);
 	} while (n > 0);
-	if (n2 != n)
+
+	/*
+	 * 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 (n < n2)
 		printf("Swap blk zone entries reduced from %lu to %lu.\n",
 		    n2, n);
 	swap_maxpages = n * SWAP_META_PAGES;


More information about the svn-src-all mailing list