Skip to content

Commit 251ff2d

Browse files
author
Peter Zijlstra
committed
perf: Simplify group_sched_in()
Collate the error paths. Code duplication only leads to divergence and extra bugs. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8c7855d commit 251ff2d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

kernel/events/core.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,11 +2580,8 @@ group_sched_in(struct perf_event *group_event,
25802580

25812581
pmu->start_txn(pmu, PERF_PMU_TXN_ADD);
25822582

2583-
if (event_sched_in(group_event, cpuctx, ctx)) {
2584-
pmu->cancel_txn(pmu);
2585-
perf_mux_hrtimer_restart(cpuctx);
2586-
return -EAGAIN;
2587-
}
2583+
if (event_sched_in(group_event, cpuctx, ctx))
2584+
goto error;
25882585

25892586
/*
25902587
* Schedule in siblings as one group (if any):
@@ -2613,10 +2610,9 @@ group_sched_in(struct perf_event *group_event,
26132610
}
26142611
event_sched_out(group_event, cpuctx, ctx);
26152612

2613+
error:
26162614
pmu->cancel_txn(pmu);
2617-
26182615
perf_mux_hrtimer_restart(cpuctx);
2619-
26202616
return -EAGAIN;
26212617
}
26222618

0 commit comments

Comments
 (0)