Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Feb 2018 22:13:41 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328955 - head/sys/vm
Message-ID:  <201802062213.w16MDfAp040215@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802062213.w16MDfAp040215>