public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Stephane Eranian <eranian@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andi Kleen <andi@firstfloor.org>, Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arjan van de Ven <arjan@infradead.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 2/3 v3] perf: Implement Nehalem uncore pmu
Date: Mon, 17 Jan 2011 09:29:29 +0800	[thread overview]
Message-ID: <1295227769.28388.82.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <AANLkTikZgmUQ2SHOL41_t-Vwss8T6tazTRJT2bVR+xRQ@mail.gmail.com>

On Fri, 2011-01-14 at 01:14 +0800, Stephane Eranian wrote:
> Lin,

Hi, Stephane, 

Sorry for late response, I'm just back from vacation.

> 
> On Thu, Dec 2, 2010 at 6:20 AM, Lin Ming <ming.m.lin@intel.com> wrote:
> > +static void uncore_pmu_enable_all(int nmi_core)
> > +{
> > +       u64 ctrl;
> > +
> > +       ctrl = ((1 << UNCORE_NUM_GENERAL_COUNTERS) - 1) | MSR_UNCORE_PERF_GLOBAL_CTRL_EN_FC0;
> > +
> > +       /* Route all interrupts to the first core that accesses uncore */
> > +       ctrl |= 1ULL << (48 + nmi_core);
> > +
> > +       wrmsrl(MSR_UNCORE_PERF_GLOBAL_CTRL, ctrl);
> > +}
> 
> Are you sure nmi_core is always between 0-3 on a 4-core system and 0-5
> on a 6-core system?
> In other words, is that what topology_core_id(raw_smp_processor_id()) returns?

I just have a look at a 6-core system, the core id is not 0-5

$ cat /proc/cpuinfo |grep "core id"
core id		: 0
core id		: 1
core id		: 2
core id		: 8
core id		: 9
core id		: 10

So we'd better route all the interrupts to the first core of the socket.

Thanks for the catch.
Lin Ming

> 
> Note that, unfortunately, I have not seen documentation that says on
> 6-core system
> UNC_GLOBAL_CTRL has 6 interrupt target bits, but it would make sense.
> 
> 
> Otherwise, you will get a kernel panic when you wrmsr UNC_GLOBAL_CTRL.
> 
> > +
> > +       if (uncore->n_events == 1) {
> > +               nmi_core = topology_core_id(raw_smp_processor_id());
> > +               uncore->nmi_core = nmi_core;
> > +               uncore_pmu_enable_all(nmi_core);
> > +       }



  reply	other threads:[~2011-01-17  1:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02  5:20 [RFC PATCH 2/3 v3] perf: Implement Nehalem uncore pmu Lin Ming
2010-12-02  5:57 ` Lin Ming
2010-12-07  6:15 ` Lin Ming
2010-12-09 19:17   ` Peter Zijlstra
2010-12-09 19:21 ` Peter Zijlstra
2010-12-09 20:15   ` Stephane Eranian
2010-12-09 20:19     ` Peter Zijlstra
2010-12-09 20:27       ` Stephane Eranian
2010-12-09 23:46   ` Stephane Eranian
2010-12-10  8:31     ` Lin Ming
2010-12-10 10:47     ` Peter Zijlstra
2010-12-10 10:52       ` Peter Zijlstra
2010-12-10 15:11         ` Cyrill Gorcunov
2010-12-11  5:49       ` Stephane Eranian
2010-12-13  8:27         ` Lin Ming
2010-12-13 16:42           ` Stephane Eranian
2010-12-13 16:51             ` Andi Kleen
2010-12-13 19:04               ` Stephane Eranian
2010-12-10  8:28   ` Lin Ming
2010-12-09 19:24 ` Peter Zijlstra
2010-12-10  8:28   ` Lin Ming
2011-01-13 17:14 ` Stephane Eranian
2011-01-17  1:29   ` Lin Ming [this message]
2011-01-17  8:44     ` Stephane Eranian
2011-01-17 10:51       ` Lin Ming
2011-01-17 10:56         ` Stephane Eranian

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=1295227769.28388.82.camel@minggr.sh.intel.com \
    --to=ming.m.lin@intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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