lkml.org 
[lkml]   [2016]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: sched out groups atomically
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!

\
 
 \ /
  Last update: 2016-08-08 15:01    [W:0.125 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site