]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf: Fix event multiplexing for exclusive groups
authorPeter Zijlstra <peterz@infradead.org>
Thu, 29 Oct 2020 15:29:53 +0000 (16:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:23 +0000 (19:22 +0100)
[ Upstream commit 2714c3962f304d031d5016c963c4b459337b0749 ]

Commit 9e6302056f80 ("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: 9e6302056f80 ("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>
kernel/events/core.c

index c245ccd426b713c769a9e46cdb28ac1fc4b62702..a06ac60d346f12c2226b0af734354161e4d40f7e 100644 (file)
@@ -2597,7 +2597,6 @@ group_error:
 
 error:
        pmu->cancel_txn(pmu);
-       perf_mux_hrtimer_restart(cpuctx);
        return -EAGAIN;
 }
 
@@ -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;