* [PATCH] perf/core: Remove redundant get_online_cpus()
@ 2017-04-17 9:16 Thomas Gleixner
0 siblings, 0 replies; only message in thread
From: Thomas Gleixner @ 2017-04-17 9:16 UTC (permalink / raw)
To: LKML; +Cc: Peter Zijlstra, Ingo Molnar, Steven Rostedt, Sebastian Siewior
SyS_perf_event_open() calls get_online_cpus() and eventually invokes
swevent_hlist_get() which does it again.
All callchains leading to swevent_hlist_get() originate from
SyS_perf_event_open() so the extra protection is redundant.
Remove it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
---
kernel/events/core.c | 5 -----
1 file changed, 5 deletions(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7592,7 +7592,6 @@ static int swevent_hlist_get(void)
{
int err, cpu, failed_cpu;
- get_online_cpus();
for_each_possible_cpu(cpu) {
err = swevent_hlist_get_cpu(cpu);
if (err) {
@@ -7600,8 +7599,6 @@ static int swevent_hlist_get(void)
goto fail;
}
}
- put_online_cpus();
-
return 0;
fail:
for_each_possible_cpu(cpu) {
@@ -7609,8 +7606,6 @@ static int swevent_hlist_get(void)
break;
swevent_hlist_put_cpu(cpu);
}
-
- put_online_cpus();
return err;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-17 9:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-17 9:16 [PATCH] perf/core: Remove redundant get_online_cpus() Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).