Skip to contentSkip to conversation

Submissions for 2.4.19-pre [slab estimate optimization (Balbir Singh)]

PATCH Michael Cohen 1 participant 1 message Feb 26, 2002 Memory management

lore
Share & tools
lore
#0 lore raw

This is the fifth of several mails containing patches to be included in 2.4.19. Some are worthy of dicussion prior to inclusion and have been marked as such. The majority of these patches were found on lkml; the remaining ones have URLs listed.

This one originated on lkml some months ago.

------
Michael Cohen
OhDarn.net

mm/slab.c +2 -2
@@ -397,10 +397,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)