All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 1/2] perf: Fix the software events state check
Date: Wed, 9 Mar 2011 14:52:55 +0100	[thread overview]
Message-ID: <20110309135252.GB1730@nowhere> (raw)
In-Reply-To: <20110309092818.GC25004@elte.hu>

On Wed, Mar 09, 2011 at 10:28:18AM +0100, Ingo Molnar wrote:
> 
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
> 
> > Fix the mistakenly inverted check of events state.
> > 
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > Cc: Ingo Molnar <mingo@elte.hu>
> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Cc: Paul Mackerras <paulus@samba.org>
> > Cc: Stephane Eranian <eranian@google.com>
> > ---
> >  kernel/perf_event.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/kernel/perf_event.c b/kernel/perf_event.c
> > index ed253aa..974e2e6 100644
> > --- a/kernel/perf_event.c
> > +++ b/kernel/perf_event.c
> > @@ -5122,7 +5122,7 @@ static int perf_exclude_event(struct perf_event *event,
> >  			      struct pt_regs *regs)
> >  {
> >  	if (event->hw.state & PERF_HES_STOPPED)
> > -		return 0;
> > +		return 1;
> 
> Just wondering, what was/is the practical effect of this bug, and how far back does 
> it go (any need for a -stable tag)?

I wasn't sure about that so I haven't told about the impact in the
changelog.

But now that I put a deeper look into this:

It seems that ->stop() / ->start() are called from perf_adjust_period()
to update the hardware with the new settings of period_left. The events
are stopped to avoid any race with events triggering with a stale period_left
in the hardware level when the software one has been updated, I guess.

So it doesn't seem to fix any existing bug because for ->stop() and ->start()
are only useful for hardware events right now. But we may call ->stop() and
->start() for further purpose later. In fact that paves the way for the event
exclusion patchset I'm about to post.

So it should be .39 material. But a confirmation from Peter would be nice.

  reply	other threads:[~2011-03-09 13:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 20:27 [PATCH 1/2] perf: Fix the software events state check Frederic Weisbecker
2011-03-07 20:27 ` [PATCH 2/2] perf: Handle stopped state with tracepoints Frederic Weisbecker
2011-03-16 13:58   ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker
2011-03-09  9:28 ` [PATCH 1/2] perf: Fix the software events state check Ingo Molnar
2011-03-09 13:52   ` Frederic Weisbecker [this message]
2011-03-09 13:55     ` Peter Zijlstra
2011-03-16 13:58 ` [tip:perf/urgent] " tip-bot for Frederic Weisbecker

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=20110309135252.GB1730@nowhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.