slab.c cleanup
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Brian Gerst
Quoted 3 lines · Manfred Spraul
No, the patch is a bad thing: It means that everyone who does
kmalloc(32,)now allocates 128 bytes, i.e. 3/4 wasted. IMHO not acceptable.Perhaps, but it currently is already allocating 128 bytes for smaller caches, because the cache is created with
SLAB_HWCACHE_ALIGN. So we ended up with redundantly sized caches.
Doesn't this code in kmem_cache_create() handle this already?
Quoted 7 lines
if (flags & SLAB_HWCACHE_ALIGN) {
/* Need to adjust size so that objs are cache aligned. */
/* Small obj size, can get at least two per cache line. */
while (size < align/2)
align /= 2;
size = (size+align-1)&(~(align-1));
}Arnd <><