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);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to