Re: [PATCH v2 1/2] kmem_cache: include allocators code directly into slab_common

From: Pekka Enberg
Date: Wed Oct 24 2012 - 14:02:28 EST


On Wed, Oct 24, 2012 at 4:59 PM, Glauber Costa <glommer@xxxxxxxxxxxxx> wrote:
> While the goal of slab_common.c is to have a common place for all
> allocators, we face two different goals that are in opposition to each
> other:
>
> 1) Have the different layouts be the business of each allocator, in
> their .c
> 2) inline as much as we can for fast paths
>
> Because of that, we either have to move all the entry points to the
> mm/slab.h and rely heavily on the pre-processor, or include all .c files
> in here.
>
> The pre-processor solution has the disadvantage that some quite
> non-trivial code gets even more non-trivial, and we end up leaving for
> readers a non-pleasant indirection.
>
> To keep this sane, we'll include the allocators .c files in here. Which
> means we will be able to inline any code they produced, but never the
> other way around!
>
> Doing this produced a name clash. This was resolved in this patch
> itself.
>
> Signed-off-by: Glauber Costa <glommer@xxxxxxxxxxxxx>
> CC: Joonsoo Kim <js1304@xxxxxxxxx>
> CC: David Rientjes <rientjes@xxxxxxxxxx>
> CC: Pekka Enberg <penberg@xxxxxxxxxx>
> CC: Christoph Lameter <cl@xxxxxxxxx>

So I hate this patch with a passion. We don't have any fastpaths in
mm/slab_common.c nor should we. Those should be allocator specific.

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