[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <160501231880.11244.5143559563506354630.tip-bot2@tip-bot2>
Date: Tue, 10 Nov 2020 12:45:18 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: perf/urgent] perf: Simplify group_sched_in()
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 251ff2d49347793d348babcff745289b11910e96
Gitweb: https://git.kernel.org/tip/251ff2d49347793d348babcff745289b11910e96
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Thu, 29 Oct 2020 16:29:15 +01:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Mon, 09 Nov 2020 18:12:35 +01:00
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@...radead.org>
Link: https://lkml.kernel.org/r/20201029162901.972161394@infradead.org
---
kernel/events/core.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9a57366..f0e5268 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;
}
Powered by blists - more mailing lists