Use correct arithmetic to calculate how many pages we need for kegs

and hashes.  There is no functional change with current sizes.
This commit is contained in:
Gleb Smirnoff 2018-02-06 22:13:40 +00:00
parent e2068d0bcd
commit d2be4a1e4f

View File

@ -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);
}