svn commit: r331872 - head/sys/vm

Gleb Smirnoff glebius at FreeBSD.org
Mon Apr 2 05:14:32 UTC 2018


Author: glebius
Date: Mon Apr  2 05:14:31 2018
New Revision: 331872
URL: https://svnweb.freebsd.org/changeset/base/331872

Log:
  In uma_startup_count() handle special case when zone will fit into
  single slab, but with alignment adjustment it won't. Again, when
  there is only one item in a slab alignment can be ignored. See
  previous revision of this file for more info.
  
  PR:		227116

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Mon Apr  2 05:11:59 2018	(r331871)
+++ head/sys/vm/uma_core.c	Mon Apr  2 05:14:31 2018	(r331872)
@@ -1828,9 +1828,11 @@ uma_startup_count(int vm_zones)
 #endif
 
 	/* Memory for the rest of startup zones, UMA and VM, ... */
-	if (zsize > UMA_SLAB_SIZE)
+	if (zsize > UMA_SLAB_SPACE)
 		pages += (zones + vm_zones) *
 		    howmany(roundup2(zsize, UMA_BOOT_ALIGN), UMA_SLAB_SIZE);
+	else if (roundup2(zsize, UMA_BOOT_ALIGN) > UMA_SLAB_SPACE)
+		pages += zones;
 	else
 		pages += howmany(zones,
 		    UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN));


More information about the svn-src-head mailing list