Skip to content

Commit

Permalink
perf: Fix event multiplexing for exclusive groups
Browse files Browse the repository at this point in the history
[ Upstream commit 2714c39 ]

Commit 9e63020 ("perf: Use hrtimers for event multiplexing")
placed the hrtimer (re)start call in the wrong place.  Instead of
capturing all scheduling failures, it only considered the PMU failure.

The result is that groups using perf_event_attr::exclusive are no
longer rotated.

Fixes: 9e63020 ("perf: Use hrtimers for event multiplexing")
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20201029162902.038667689@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Peter Zijlstra authored and gregkh committed Nov 18, 2020
1 parent 3a5a900 commit 7dce450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,6 @@ group_sched_in(struct perf_event *group_event,

error:
pmu->cancel_txn(pmu);
perf_mux_hrtimer_restart(cpuctx);
return -EAGAIN;
}

Expand Down Expand Up @@ -3653,6 +3652,7 @@ static int merge_sched_in(struct perf_event *event, void *data)

*can_add_hw = 0;
ctx->rotate_necessary = 1;
perf_mux_hrtimer_restart(cpuctx);
}

return 0;
Expand Down

0 comments on commit 7dce450

Please sign in to comment.