From: Stephane Eranian <eranian@hpl.hp.com>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, perfmon@napali.hpl.hp.com
Subject: Re: exposing FSB clock speed in /sys
Date: Mon, 2 Apr 2007 13:52:58 -0700 [thread overview]
Message-ID: <20070402205258.GB32024@frankl.hpl.hp.com> (raw)
In-Reply-To: <20070402161443.GD3510@csclub.uwaterloo.ca>
Len,
On Mon, Apr 02, 2007 at 12:14:43PM -0400, Lennart Sorensen wrote:
> On Sat, Mar 31, 2007 at 12:18:32AM -0800, Stephane Eranian wrote:
> > Well, I am talking about the bus that connects the processor socket to the
> > chipset on Intel machines. On Intel Core 2 Duo (aka Woodcrest), you have
> > 2 sockets, thus two buses connecting to the chipset which then connects
> > to the memory (among other things).
> >
> > The Woodcrest (Intel Core PMU) is capable of measuring the number of bus
> > transactions to memory (look at the BUS_* events). You can count per core
> > or for the entire socket (both cores). In order to know if you saturate
> > the bus (from socket to chipset), you need to know the theoretical peak
> > number of transactions the bus can sustain. For that you need to bus
> > frequency.
> >
> > I am not interested in older processors, but I think for all recent Intel
> > processors, there is a fairly simple algorithm to get the frequency using
> > a couple of MSRs (including MSR_IA32_EBL_CR_POWERON or MSR_FSB_FREQ).
> >
> > Don't we already have /sys entries that exits only for certain processors
> > or platforms?
> >
> > I think the Opteron have HYPERTRANSPORT-related events which could be used
> > to obtain similar metrics.
> >
> > Knowledge of bus saturation is important for multi-core programming.
>
> How about the speed between ram and the chipset? Is it single or dual
> channel? Are there PCI devices currently doing DMA transfers to ram
> taking up bandwidth? What are the latencies of the ram, Etc, etc, etc.
This is information you can normally collect form chipset performance
counters. Unfortunately, those are rarely public.
I am focusing on what you can measure using the CPU performance counters.
>
> And what could your software do differently if it knew this information?
>
That is a good question! Thanks for asking.
Assuming you are using a dual core machine, if you would know the bus utilization,
you could determine whether or not it is worth using the 2nd core for your workload.
If one thread already saturates the bus, you can either use the 2nd core for a
non memory-bound workload, or just leave it unused. As you can guess, this information
could be used for thread placement.
Similarly, if you see a low bus utilization for a memory-bound program, then this
could be a sign that the program is not well optimized, e.g., not issuing software
prefetch. Here this is about code tuning.
There a lot of information to be gleaned for using the performance counters especially
for multi-core platforms.
--
-Stephane
prev parent reply other threads:[~2007-04-02 20:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-30 15:39 Stephane Eranian
2007-03-30 15:49 ` Arjan van de Ven
2007-03-30 18:20 ` Alan Cox
2007-03-30 18:44 ` [perfmon] " Martin Cracauer
2007-03-31 2:31 ` Andi Kleen
2007-03-31 8:18 ` Stephane Eranian
2007-03-31 10:02 ` Andi Kleen
2007-04-02 16:14 ` Lennart Sorensen
2007-04-02 20:52 ` Stephane Eranian [this message]
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=20070402205258.GB32024@frankl.hpl.hp.com \
--to=eranian@hpl.hp.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsorense@csclub.uwaterloo.ca \
--cc=perfmon@napali.hpl.hp.com \
/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
all inboxes | Powered by JetHome®