From: Nick Piggin <npiggin@suse.de>
To: Jan Beulich <JBeulich@novell.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Arjan van de Ven <arjan@infradead.org>,
tglx@linutronix.de, Shai Fultheim <shai@scalemp.com>,
Ravikiran Thirumalai <kiran@scalex86.org>,
linux-kernel@vger.kernel.org, hpa@zytor.com
Subject: Re: [PATCH] x86: eliminate redundant/contradicting cache line size config options
Date: Thu, 19 Nov 2009 11:00:56 +0100 [thread overview]
Message-ID: <20091119100056.GA5602@wotan.suse.de> (raw)
In-Reply-To: <4B0512060200007800020C42@vpn.id2.novell.com>
On Thu, Nov 19, 2009 at 08:38:14AM +0000, Jan Beulich wrote:
> >>> Nick Piggin <npiggin@suse.de> 19.11.09 09:13 >>>
> >On Wed, Nov 18, 2009 at 08:52:40PM -0800, Arjan van de Ven wrote:
> >Basically what I think we should do is consider L1_CACHE_BYTES to be
> >*the* correct default value to use for 1) avoiding false sharing (which
> >seems to be the most common use), and 2) optimal and repeatable per-object
> >packing into cachelines (which is more of a micro-optimization to be
> >applied carefully to really critical structures).
>
> But then this really shouldn't be called L1_CACHE_... Though I realize
> that the naming seems to already be broken - looking over the cache
> line specifiers for CPUID leaf 2, there's really no L1 with 128 byte lines,
> just two L2s.
Yes, I agree L1_CACHE is not the best name. In what situation would
you *only* care about L1 cache line size, without knowing any other
line sizes? IMO only in the case where you also know more details
about L1 cache like size and write some particular cache blocking or
algorithm like that. And we don't really do that in kernel, especially
not in generic code.
> One question however is whether e.g. cache line ping-pong between
> L3s is really costing that much on non-NUMA, as opposed to it
> happening between L1s.
Well I think we still need to work to minimise intra-chip bouncing
even though it is far cheaper than inter-chip. It is still costly
and probably costs more power too. And as core count continues to
increase, I think even intra-chip bouncing costs are going to become
important (8 core Nehalem I think already doesn't have a true
unified L3 cache with crossbars to each core but has 8 L3 caches
connected with ring busses).
I don't think it makes too much sense to add much complexity to
say "oh we don't care about bouncing between threads on core or
cores on chip" because I haven't seen anywhere we can get a
significant data size benefit, and it often slows down the straight
line performance too (eg. per-cpu variable can often be non atomic,
but when you even share it between threads on a core then you have
to start using atomics).
next prev parent reply other threads:[~2009-11-19 10:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 11:54 [PATCH] x86: eliminate redundant/contradicting cache line size config options Jan Beulich
2009-11-16 4:14 ` Nick Piggin
2009-11-16 8:08 ` Jan Beulich
2009-11-16 10:56 ` Nick Piggin
2009-11-19 3:56 ` Ingo Molnar
2009-11-19 4:52 ` Arjan van de Ven
2009-11-19 8:13 ` Nick Piggin
2009-11-19 8:38 ` Jan Beulich
2009-11-19 10:00 ` Nick Piggin [this message]
2009-11-19 15:59 ` Arjan van de Ven
2009-11-19 16:18 ` Nick Piggin
2009-11-19 17:53 ` Andi Kleen
2009-11-23 8:34 ` Ingo Molnar
2009-11-23 9:35 ` Nick Piggin
2009-11-23 10:09 ` Ingo Molnar
2009-11-23 14:52 ` Arjan van de Ven
2009-11-23 15:15 ` Nick Piggin
2009-11-19 4:42 ` [tip:x86/mm] x86: Eliminate " tip-bot for Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091119100056.GA5602@wotan.suse.de \
--to=npiggin@suse.de \
--cc=JBeulich@novell.com \
--cc=arjan@infradead.org \
--cc=hpa@zytor.com \
--cc=kiran@scalex86.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=shai@scalemp.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox