[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070410050047.GA6150@localhost.localdomain>
Date: Mon, 9 Apr 2007 22:00:47 -0700
From: Ravikiran G Thirumalai <kiran@...lex86.org>
To: "Siddha, Suresh B" <suresh.b.siddha@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, mingo@...e.hu,
nickpiggin@...oo.com.au, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...e.de>
Subject: Re: [patch] sched: align rq to cacheline boundary
On Mon, Apr 09, 2007 at 03:17:05PM -0700, Siddha, Suresh B wrote:
> On Mon, Apr 09, 2007 at 02:53:09PM -0700, Ravikiran G Thirumalai wrote:
> > On Mon, Apr 09, 2007 at 01:40:57PM -0700, Andrew Morton wrote:
> > > On Mon, 9 Apr 2007 11:08:53 -0700
> > > "Siddha, Suresh B" <suresh.b.siddha@...el.com> wrote:
>
> Kiran, can you educate me when I am supposed to use
> ____cacheline_aligned_in_smp
> Vs
> __cacheline_aligned_in_smp ?
As far as my understanding goes, the four underscore version is for
aligning members/elements within a data structure, and the two underscore
version is for aligning statically defined variables.
The dual underscore version places the variable in a separate section meant
for cacheline aligned variables, so that there is no false sharing on the
cacheline with a consecutive datum. For regular statically defined data
structures, the latter has to be used, but since your patch uses per-cpu data,
which is already in a separate section, you had to use the former I guess.
>
> > As for the (linesize-4 * NR_CPUS) wastage, maybe we can place the cacheline
> > aligned per-cpu data in another section, just like we do with
> > .data.cacheline_aligned section, but keep this new section between
> > __percpu_start and __percpu_end?
>
> Yes. But that will still waste some memory in the new section, if the data
> elements are not multiples of 4k.
Yes. But the wastage depends on the data structure now being aligned rather
than the structure that happened to be there before. You cannot not lose
memory while padding I guess :). But padding for per-cpu data seems a bit
odd and I am not sure if it is worth it for 0.5% gain.
Thanks,
Kiran
-
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