svn commit: r328955 - head/sys/vm

Gleb Smirnoff glebius at FreeBSD.org
Tue Feb 6 22:13:41 UTC 2018


Author: glebius
Date: Tue Feb  6 22:13:40 2018
New Revision: 328955
URL: https://svnweb.freebsd.org/changeset/base/328955

Log:
  Use correct arithmetic to calculate how many pages we need for kegs
  and hashes.  There is no functional change with current sizes.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Tue Feb  6 22:10:07 2018	(r328954)
+++ head/sys/vm/uma_core.c	Tue Feb  6 22:13:40 2018	(r328955)
@@ -1810,14 +1810,14 @@ uma_startup_count(int zones)
 		pages += howmany(zones, UMA_SLAB_SIZE / zsize);
 
 	/* ... and their kegs. */
-	pages += howmany(ksize * zones, UMA_SLAB_SIZE);
+	pages += howmany(zones, UMA_SLAB_SIZE / ksize);
 
 	/*
 	 * Take conservative approach that every zone
 	 * is going to allocate hash.
 	 */
-	pages += howmany(sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT *
-	    zones, UMA_SLAB_SIZE);
+	pages += howmany(zones, UMA_SLAB_SIZE /
+	    (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT));
 
 	return (pages);
 }


More information about the svn-src-all mailing list