All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: Re: [PATCH] perf: sched out groups atomically
Date: Mon, 8 Aug 2016 14:12:46 +0200	[thread overview]
Message-ID: <20160808121246.GD6879@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1469553141-28314-1-git-send-email-mark.rutland@arm.com>

On Tue, Jul 26, 2016 at 06:12:21PM +0100, Mark Rutland wrote:
> Groups of events are supposed to be scheduled atomically, such that it
> is possible to derive meaningful ratios between their values.
> 
> We take great pains to achieve this when scheduling event groups to a
> PMU in group_sched_in(), calling {start,commit}_txn() (which fall back
> to perf_pmu_{disable,enable}() if necessary) to provide this guarantee.
> However we don't mirror this in group_sched_out(), and in some cases
> events will not be scheduled out atomically.
> 
> For example, if we disable an event group with PERF_EVENT_IOC_DISABLE,
> we'll cross-call __perf_event_disable() for the group leader, and will
> call group_sched_out() without having first disabled the relevant PMU.
> We will disable/enable the PMU around each pmu->del() call, but between
> each call the PMU will be enabled and events may count.
> 
> Avoid this by explicitly disabling and enabling the PMU around event
> removal in group_sched_out(), mirroring what we do in group_sched_in().

Thanks!

  reply	other threads:[~2016-08-08 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 17:12 [PATCH] perf: sched out groups atomically Mark Rutland
2016-08-08 12:12 ` Peter Zijlstra [this message]
2016-08-10 17:57 ` [tip:perf/core] perf/core: Sched " tip-bot for Mark Rutland

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=20160808121246.GD6879@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.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 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.