Re: [PATCH] slab.c cleanup

From: Manfred Spraul (manfred@colorfullife.com)
Date: Sun Mar 23 2003 - 16:20:42 EST


Brian Gerst wrote:

>
> 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.
>

linux/mm/slab.c:

> 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));
> }
>
>
HWALIGN is just a hint, the implementation ignores it if it results in
unreasonable wasting of memory.

--
    Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:45 EST