[PATCH v3 56/57] perf: Simplify perf_pmu_output_stop()
Peter Zijlstra
peterz at infradead.org
Mon Jun 12 09:08:09 UTC 2023
Signed-off-by: Peter Zijlstra (Intel) <peterz at infradead.org>
---
kernel/events/core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7977,7 +7977,8 @@ static void perf_pmu_output_stop(struct
int err, cpu;
restart:
- rcu_read_lock();
+ /* cannot have a label in front of a decl */;
+ guard(rcu)();
list_for_each_entry_rcu(iter, &event->rb->event_list, rb_entry) {
/*
* For per-CPU events, we need to make sure that neither they
@@ -7993,12 +7994,9 @@ static void perf_pmu_output_stop(struct
continue;
err = cpu_function_call(cpu, __perf_pmu_output_stop, event);
- if (err == -EAGAIN) {
- rcu_read_unlock();
+ if (err == -EAGAIN)
goto restart;
- }
}
- rcu_read_unlock();
}
/*
More information about the Linux-security-module-archive
mailing list