Fix KASSERTs: maximum number of items per slab is 256.

This commit is contained in:
Gleb Smirnoff 2013-04-09 12:20:44 +00:00
parent 4f9d403c2e
commit 025071f2af

View File

@ -1171,7 +1171,7 @@ keg_small_init(uma_keg_t keg)
}
keg->uk_ipers = (keg->uk_slabsize - shsize) / rsize;
KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= 255,
KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= 256,
("%s: keg->uk_ipers %u", __func__, keg->uk_ipers));
memused = keg->uk_ipers * rsize + shsize;
@ -1191,7 +1191,7 @@ keg_small_init(uma_keg_t keg)
if ((wastedspace >= keg->uk_slabsize / UMA_MAX_WASTE) &&
(keg->uk_ipers < (keg->uk_slabsize / keg->uk_rsize))) {
keg->uk_ipers = keg->uk_slabsize / keg->uk_rsize;
KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= 255,
KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= 256,
("%s: keg->uk_ipers %u", __func__, keg->uk_ipers));
#ifdef UMA_DEBUG
printf("UMA decided we need offpage slab headers for "
@ -1726,7 +1726,7 @@ uma_startup(void *bootmem, int boot_pages)
objsize--;
uma_max_ipers_ref = MAX(UMA_SLAB_SIZE / objsize, 64);
KASSERT((uma_max_ipers_ref <= 255) && (uma_max_ipers <= 255),
KASSERT((uma_max_ipers_ref <= 256) && (uma_max_ipers <= 256),
("uma_startup: calculated uma_max_ipers values too large!"));
#ifdef UMA_DEBUG