[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 3 Mar 2008 13:31:14 -0800 (PST)
From: Christoph Lameter <clameter@....com>
To: Nick Piggin <npiggin@...e.de>
cc: netdev@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
yanmin_zhang@...ux.intel.com, David Miller <davem@...emloft.net>,
Eric Dumazet <dada1@...mosbay.com>
Subject: Re: [rfc][patch 2/3] slab: introduce SMP alignment
On Mon, 3 Mar 2008, Nick Piggin wrote:
> On Mon, Mar 03, 2008 at 12:17:20PM -0800, Christoph Lameter wrote:
> > On Mon, 3 Mar 2008, Nick Piggin wrote:
> >
> > > > You want two ways of specifying alignments?
> > >
> > > I want a way to ask for SMP friendly allocation.
> >
> > Then align the objects at cacheline boundaries by providing a value for
> > the align parameter to kmem_cache_create().
>
> max(num_possible_cpus() > 1 ? cache_line_size() : 0, mandatory_alignment)?
The mandatory alignment is applied anyways. You do not need to max() on
that.
One could simply specify cache_line_size() with Pekka's patch.
cache_line_size() could default to 0 if !SMP.
> Then suppose we want a CONFIG_TINY option to eliminate it?
No slab allocator supports that right now. However, SLOB in the past has
ignored the alignment in order to reduce memory use. So maybe Matt wants
to introduce this?
> And maybe the VSMP guys will want to blow this out to their internode
> alignment?
>
> max(!CONFIG_TINY && num_possible_cpus() > 1 ? (is_vsmp ? internode_alignemnt : cache_line_size()) : 0, mandatory_alignment)
No the slab allocators were optimized for VSMP so that the
internode_alignment is not necessary there. That was actually one of the
requirements that triggered the slab numa work.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists