public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@google.com>,
	Cyrill Gorcunov <gorcunov@gmail.com>,
	Zhang Yanmin <yanmin_zhang@linux.intel.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 1/5] perf: Provide a proper stop action for software events
Date: Sat, 12 Jun 2010 18:25:55 +0200	[thread overview]
Message-ID: <20100612162551.GA5235@nowhere> (raw)
In-Reply-To: <1276335791.2077.3095.camel@twins>

On Sat, Jun 12, 2010 at 11:43:11AM +0200, Peter Zijlstra wrote:
> On Sat, 2010-06-12 at 09:34 +0200, Frederic Weisbecker wrote:
> > In order to introduce new context exclusions, software events will
> > have to eventually stop when needed. We'll want perf_event_stop() to
> > act on every events.
> > 
> > To achieve this, remove the stub stop/start pmu callbacks of software
> > and tracepoint events that fixed a race in perf_adjust_period, and do
> > an explicit check to only reset the hardware event using the
> > start/stop callbacks.
> 
> I really object to this,. its just too ugly to live.


Several propositions of alternatives then, please tell me if one
looks more palatable to you:

- Having an argument on ->stop() and ->start() callback which
  would be reset_period. If reset_period is true, then the event
  knows the goal is to reprogram the interrupt.

  FWIW, that's my prefered solution, software pmus can just check
  this and return immediately. This avoids all the race between
  concurrent stat and stop plus the wasteful/useless hlist
  manipulation.

- Having a nesting level control on stop and start, so that
  we only call stop/start on nesting level 0. That solves the race.

- Having a flag in the pmu that tells if it wants to reprogram
  on period reset. Then we know if we need the start/stop against
  this flag. I just propose this one for the fun, I already
  know it sucks :)

Thanks.


  reply	other threads:[~2010-06-12 16:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-12  7:34 [PATCH 0/5 v3] perf events finer grained context instrumentation / context exclusion Frederic Weisbecker
2010-06-12  7:34 ` [PATCH 1/5] perf: Provide a proper stop action for software events Frederic Weisbecker
2010-06-12  9:43   ` Peter Zijlstra
2010-06-12 16:25     ` Frederic Weisbecker [this message]
2010-06-12  7:34 ` [PATCH 2/5] perf: Support disable() after stop() on " Frederic Weisbecker
2010-06-12  7:34 ` [PATCH 3/5] perf: Ability to enable in a paused mode Frederic Weisbecker
2010-06-12  9:44   ` Peter Zijlstra
2010-06-12 16:44     ` Frederic Weisbecker
2010-06-12  7:34 ` [PATCH 4/5] perf: Introduce task, softirq and hardirq contexts exclusion Frederic Weisbecker
2010-06-12  7:34 ` [PATCH 5/5] perf: Support for task/softirq/hardirq exclusion on tools Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2010-06-10  3:49 [PATCH 0/5] perf events finer grained context instrumentation / context exclusion Frederic Weisbecker
2010-06-10  3:49 ` [PATCH 1/5] perf: Provide a proper stop action for software events Frederic Weisbecker
2010-06-10 10:46   ` Peter Zijlstra
2010-06-10 11:10     ` Peter Zijlstra
2010-06-10 16:12       ` Frederic Weisbecker
2010-06-10 16:16         ` Peter Zijlstra
2010-06-10 16:29           ` Frederic Weisbecker
2010-06-10 16:38             ` Peter Zijlstra
2010-06-10 17:04               ` Frederic Weisbecker
2010-06-10 19:54           ` Frederic Weisbecker
2010-06-10 12:06     ` 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=20100612162551.GA5235@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=yanmin_zhang@linux.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