Skip to content

Commit 3a5a900

Browse files
Peter Zijlstragregkh
authored andcommitted
perf: Simplify group_sched_in()
[ Upstream commit 251ff2d ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e360c1e commit 3a5a900

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎kernel/events/core.c‎

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

25662566
pmu->start_txn(pmu, PERF_PMU_TXN_ADD);
25672567

2568-
if (event_sched_in(group_event, cpuctx, ctx)) {
2569-
pmu->cancel_txn(pmu);
2570-
perf_mux_hrtimer_restart(cpuctx);
2571-
return -EAGAIN;
2572-
}
2568+
if (event_sched_in(group_event, cpuctx, ctx))
2569+
goto error;
25732570

25742571
/*
25752572
* Schedule in siblings as one group (if any):
@@ -2598,10 +2595,9 @@ group_sched_in(struct perf_event *group_event,
25982595
}
25992596
event_sched_out(group_event, cpuctx, ctx);
26002597

2598+
error:
26012599
pmu->cancel_txn(pmu);
2602-
26032600
perf_mux_hrtimer_restart(cpuctx);
2604-
26052601
return -EAGAIN;
26062602
}
26072603

0 commit comments

Comments
 (0)