[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1502131315500.24226@chino.kir.corp.google.com>
Date: Fri, 13 Feb 2015 13:20:10 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Christoph Lameter <cl@...ux.com>
cc: Joonsoo Kim <iamjoonsoo.kim@....com>, akpm@...uxfoundation.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
penberg@...nel.org, iamjoonsoo@....com,
Jesper Dangaard Brouer <brouer@...hat.com>
Subject: Re: [PATCH 1/3] Slab infrastructure for array operations
On Fri, 13 Feb 2015, Christoph Lameter wrote:
> > I also think that this implementation is slub-specific. For example,
> > in slab case, it is always better to access local cpu cache first than
> > page allocator since slab doesn't use list to manage free objects and
> > there is no cache line overhead like as slub. I think that,
> > in kmem_cache_alloc_array(), just call to allocator-defined
> > __kmem_cache_alloc_array() is better approach.
>
> What do you mean by "better"? Please be specific as to where you would see
> a difference. And slab definititely manages free objects although
> differently than slub. SLAB manages per cpu (local) objects, per node
> partial lists etc. Same as SLUB. The cache line overhead is there but no
> that big a difference in terms of choosing objects to get first.
>
I think because we currently lack a non-fallback implementation for slab
that it may be premature to discuss what would be unified if such an
implementation were to exist. That unification can always happen later
if/when the slab implementation is proposed, but I don't think we should
be unifying an implementation that doesn't exist.
In other words, I think it would be much cleaner to do just define the
generic array alloc and array free functions in mm/slab_common.c along
with their EXPORT_SYMBOL()'s as simple callbacks to per-allocator
__kmem_cache_{alloc,free}_array() implementations. I think it's also
better from a source code perspective to avoid reading two different
functions and then realizing that nothing is actually unified between them
(and the absence of an unnecessary #ifdef is currently helpful).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists