mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: perf: rdpmc bug when viewing all procs on remote cpu
Date: Fri, 18 Jan 2019 13:01:49 +0100	[thread overview]
Message-ID: <20190118120149.GC27931@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.21.1901111649580.6487@macbook-air>

On Fri, Jan 11, 2019 at 04:52:22PM -0500, Vince Weaver wrote:
> On Thu, 10 Jan 2019, Vince Weaver wrote:
> 
> > On Thu, 10 Jan 2019, Vince Weaver wrote:
> > 
> > > On Thu, 10 Jan 2019, Vince Weaver wrote:
> > > 
> > > > However if you create an all-process attached to CPU event:
> > > > 	perf_event_open(attr, -1, X, -1, 0);
> > > > the mmap event index is set as if this were a valid event and so the rdpmc
> > > > succeeds even though it shouldn't (we're trying to read an event value
> > > > on a remote cpu with a local rdpmc).
> 
> so on further looking at the code, it doesn't appear that rdpmc events are 
> explicitly marked as unavailable in the attach-cpu or attach-pid case, 
> it's just by luck the check for PERF_EVENT_STATE_ACTIVE catches most of 
> the cases?
> 
> should an explicit check be added to zero out userpg->index in cases where 
> the event being measured is running on a different core?

And how would we konw? We don't know what CPU will be observing the
mmap().

RDPMC fundamentally only makes sense on 'self' (either task or CPU).

  reply	other threads:[~2019-01-18 12:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 17:35 Vince Weaver
2019-01-10 17:50 ` Vince Weaver
2019-01-10 20:00   ` Vince Weaver
2019-01-11 21:52     ` Vince Weaver
2019-01-18 12:01       ` Peter Zijlstra [this message]
2019-01-18 14:09         ` Vince Weaver
2019-01-18 15:58           ` Peter Zijlstra
2019-01-18 17:24             ` Vince Weaver
2019-01-18 20:10               ` Peter Zijlstra

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=20190118120149.GC27931@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=vincent.weaver@maine.edu \
    /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

Powered by JetHome