summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-10-29 16:29:15 +0100
committerPeter Zijlstra <peterz@infradead.org>2020-11-09 18:12:35 +0100
commit251ff2d49347793d348babcff745289b11910e96 (patch)
treed3228ab7e59793004c3bd88eeb4ee9fd68f844f5 /kernel
parentperf: Simplify group_sched_out() (diff)
downloadlinux-251ff2d49347793d348babcff745289b11910e96.tar.xz
linux-251ff2d49347793d348babcff745289b11910e96.zip
perf: Simplify group_sched_in()
Collate the error paths. Code duplication only leads to divergence and extra bugs. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20201029162901.972161394@infradead.org
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9a5736617a82..f0e526866a1c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2580,11 +2580,8 @@ group_sched_in(struct perf_event *group_event,
pmu->start_txn(pmu, PERF_PMU_TXN_ADD);
- if (event_sched_in(group_event, cpuctx, ctx)) {
- pmu->cancel_txn(pmu);
- perf_mux_hrtimer_restart(cpuctx);
- return -EAGAIN;
- }
+ if (event_sched_in(group_event, cpuctx, ctx))
+ goto error;
/*
* Schedule in siblings as one group (if any):
@@ -2613,10 +2610,9 @@ group_error:
}
event_sched_out(group_event, cpuctx, ctx);
+error:
pmu->cancel_txn(pmu);
-
perf_mux_hrtimer_restart(cpuctx);
-
return -EAGAIN;
}