public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Dave Jones <davej@redhat.com>,
	x86@kernel.org, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Update cacheline size on X86_GENERIC
Date: Fri, 10 Oct 2008 09:46:01 +0200	[thread overview]
Message-ID: <87tzbksxja.fsf@basil.nowhere.org> (raw)
In-Reply-To: <200810101428.23662.nickpiggin@yahoo.com.au> (Nick Piggin's message of "Fri, 10 Oct 2008 14:28:23 +1100")

Nick Piggin <nickpiggin@yahoo.com.au> writes:

> On Friday 10 October 2008 04:14, Dave Jones wrote:
>> I just noticed that configuring a kernel to use CONFIG_X86_GENERIC
>> (as is typical for a distro kernel) configures it to use a 128 byte
>> cacheline size. This made sense when that was commonplace (P4 era) but
>> current
>> Intel, AMD and VIA cpus use 64 byte cachelines.
>
> I think P4 technically did have 64 byte cachelines, but had some adjacent
> line prefetching.

The "coherency unit" on P4, which is what matters for SMP alignment
purposes to avoid false sharing, is 128 bytes.

> And AFAIK core2 CPUs can do similar prefetching (but
> maybe it's smarter and doesn't cause so much bouncing?).

On Core2 the coherency unit is 64bytes.

> Anyway, GENERIC kernel should run well on all architectures, and while
> going too big causes slightly increased structures sometimes, going too
> small could result in horrible bouncing.

Exactly.

That is it costs one percent or so on TPC, but I think the fix
for that is just to analyze where the problem is and size those
data structures based on the runtime cache size. Some subsystems
like slab do this already.

TPC is a bit of a extreme case because it is so extremly cache bound.

Overall the memory impact of the cache padding is getting less over
time because more and more data is moving into the per CPU data areas.

-Andi

-- 
ak@linux.intel.com

  reply	other threads:[~2008-10-10  7:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 17:14 Update cacheline size on X86_GENERIC Dave Jones
2008-10-10  3:28 ` Nick Piggin
2008-10-10  7:46   ` Andi Kleen [this message]
2008-10-10  8:45     ` Nick Piggin
2008-10-10 10:22       ` Andi Kleen
2008-10-11  3:59         ` Nick Piggin
2008-10-11  8:08           ` Andi Kleen
2008-10-11  8:29             ` Nick Piggin
2008-10-11 11:22               ` Andi Kleen
2008-10-11 11:27                 ` Rafael J. Wysocki
2008-10-11 11:42                 ` Nick Piggin
2008-10-11 13:11                   ` Andi Kleen
2008-10-11 13:48                     ` Nick Piggin
2008-10-11 14:01                       ` Andi Kleen
2008-10-12  5:56                         ` Nick Piggin
2008-10-10 18:26   ` H. Peter Anvin
2008-10-11  3:56     ` Nick Piggin

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=87tzbksxja.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=x86@kernel.org \
    /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