public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yong Wang <yong.y.wang@linux.intel.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: eranian@gmail.com, "Wang, Yong Y" <yong.y.wang@intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	LKML <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: perf_counter Atom patch
Date: Wed, 24 Jun 2009 10:19:44 +0800	[thread overview]
Message-ID: <20090624021944.GA2808@ywang-moblin2.bj.intel.com> (raw)
In-Reply-To: <20090623094717.GA30634@elte.hu>

On Tue, Jun 23, 2009 at 11:47:17AM +0200, Ingo Molnar wrote:
> 
> * Yong Wang <yong.y.wang@linux.intel.com> wrote:
> 
> > On Tue, Jun 23, 2009 at 10:40:45AM +0200, stephane eranian wrote:
> > > Yong,
> > > 
> > > On Tue, Jun 23, 2009 at 10:27 AM, stephane
> > > eranian<eranian@googlemail.com> wrote:
> > > > Hi,
> > > >
> > > > On Tue, Jun 23, 2009 at 9:59 AM, Yong Wang<yong.y.wang@linux.intel.com> wrote:
> > > >> On Tue, Jun 23, 2009 at 09:45:03AM +0200, stephane eranian wrote:
> > > >>>
> > > >>> Unfortunately, I don't have a N270 to compare with your results.
> > > >>> We need to verify whether or not N270 implements the fixed counters.
> > > >>> Does it report architected perfmon v3 or v1?
> > > >>>
> > > >>
> > > >> All Atom processors report perfmon v3 as specified in SDM. N270 is no
> > > >> exception.
> > > >>
> > > > V3 does not set a minimal number of fixed counters, could be zero. But
> > > > that seems
> > > > odd. Let me ask around.
> > > >
> > > Second thought on this:
> > >        x86_pmu.num_counters_fixed      =
> > > max((int)edx.split.num_counters_fixed, 3);
> > > 
> > >         rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
> > > 
> > > 
> > > Forcing num_counter_fixed is not enough, you need to make sure 
> > > they are actually activated in GLOBAL_CTRL, i.e., make sure bits 
> > > 32-34 are set in intel_ctrl. Depending on which machine you're 
> > > on, the power on value for GLOBAL_CTRL changes. The correct 
> > > value for it should be that ONLY generic counters are on by 
> > > default.
> > > 
> > 
> > Oh, this might be why fixed counter do not work on my Atom box. I 
> > will look into it. [...]
> 
> Thanks - having a different bootup default for the global ctrl 
> indeed sounds like a good and plausible explanation - please send a 
> patch for that if you've tested it, removing that quirk and adding 
> the global-enable ctrl logic.
> 

The root cause of fixed counters not working on Atom is indeed related
to global counter control MSR. The power-on value on Atom is 0x3 which
means only general purpose counters are enabled by default. The power-on
value on Core2 is 0xffffffffffffffff which I believe is also the case
for Nehalem. That's why Core2 and Nehalem do not have the problem.


  reply	other threads:[~2009-06-24  2:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 20:26 perf_counter Atom patch stephane eranian
2009-06-23  3:38 ` Wang, Yong Y
2009-06-23  7:45   ` stephane eranian
2009-06-23  7:59     ` Yong Wang
2009-06-23  8:27       ` stephane eranian
2009-06-23  8:34         ` Yong Wang
2009-06-23  9:10           ` Peter Zijlstra
2009-06-23  9:40             ` stephane eranian
2009-06-23  8:40         ` stephane eranian
2009-06-23  8:53           ` Yong Wang
2009-06-23  9:19             ` stephane eranian
2009-06-23  9:47             ` Ingo Molnar
2009-06-24  2:19               ` Yong Wang [this message]
2009-06-24  8:52                 ` Ingo Molnar
2009-06-25 10:39                   ` stephane eranian
2009-06-23  5:59 ` Wang, Yong Y

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=20090624021944.GA2808@ywang-moblin2.bj.intel.com \
    --to=yong.y.wang@linux.intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=eranian@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=yong.y.wang@intel.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