public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Brown, Len" <len.brown@intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: [RFC] x86, perf: Add an aperfmperf driver
Date: Wed, 29 Apr 2015 11:13:05 +0200	[thread overview]
Message-ID: <20150429091305.GP5029@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CALCETrXQGWWAc+yYFrmHKiVAHVxPK37M2La1Q2k51xzAffbpHg@mail.gmail.com>

On Tue, Apr 28, 2015 at 03:43:38PM -0700, Andy Lutomirski wrote:
> On Tue, Apr 28, 2015 at 3:29 PM, Brown, Len <len.brown@intel.com> wrote:

> >> Thoughts?  Would it make sense at all?  Did I wire it up right?  This is
> >> the only PMU driver I've ever written, and it could have any number of
> >> issues.
> >
> > APERF/MPERF, as with all per-thread MSRs, must be accessed
> > from the local processor.  I didn't see where this driver
> > distinguishes the CPU.  Also, I assume the intent is to return
> > a snapshot, rather than sampling, yes?
> 
> I think that the perf core takes care of that for us, but I'm not entirely sure.

It does indeed. The events are always created/used in either task or cpu
context, and in the case of task context they're context switched along,
which again results in strict per cpu usage.

Since this driver has no state to track nothing else is required.

  reply	other threads:[~2015-04-29  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 21:25 [RFC] x86, perf: Add an aperfmperf driver Andy Lutomirski
2015-04-28 22:29 ` Brown, Len
2015-04-28 22:43   ` Andy Lutomirski
2015-04-29  9:13     ` Peter Zijlstra [this message]
2015-04-29  9:09 ` Peter Zijlstra
2015-04-29 18:50   ` Andy Lutomirski
2015-04-30  1:17     ` Andy Lutomirski
2015-04-30  8:51       ` Peter Zijlstra
2015-04-30 22:09         ` Andy Lutomirski
2015-04-29  9:14 ` Peter Zijlstra
2015-05-11  9:48 ` Ingo Molnar

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=20150429091305.GP5029@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.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