Anton wrote: >> - Don't create caches that are not multiples of L1_CACHE_BYTES. > >Nice idea, I often see the list walk (of the cache sizes) in kmalloc in kernel >profiles. eg a bunch of kmalloc(2k) for network drivers. > >Since we have a 128byte cacheline on ppc64 this patch should reduce that. > > 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. I agree that the list walk in kmalloc is a problem - but the right solution is a quicker lookup. Perhaps something like the attached patch. For networking: I bet that virtually all allocations have the same size - what about calling kmem_find_general_cachep, and caching the last request/result? Then the next calls can allocate directly from the appropriate cache, without any lookup. -- Manfred