diff -Naurp a/mm/slab.c b/mm/slab.c --- a/mm/slab.c Wed Jul 17 12:25:04 2002 +++ b/mm/slab.c Wed Jul 17 12:25:04 2002 @@ -399,10 +399,10 @@ base = sizeof(slab_t); extra = sizeof(kmem_bufctl_t); } - i = 0; + i = (wastage - base)/(size + extra); while (i*size + L1_CACHE_ALIGN(base+i*extra) <= wastage) i++; - if (i > 0) + while (i*size + L1_CACHE_ALIGN(base+i*extra) > wastage) i--; if (i > SLAB_LIMIT)