Skip to content

Commit

Permalink
x86/mtrr: Remove get_online_cpus() from mtrr_save_state()
Browse files Browse the repository at this point in the history
mtrr_save_state() is invoked from native_cpu_up() which is in the context
of a CPU hotplug operation and therefor calling get_online_cpus() is
pointless.

While this works in the current get_online_cpus() implementation it
prevents from converting the hotplug locking to percpu rwsems.

Remove it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170524081547.651378834@linutronix.de
  • Loading branch information
Sebastian Andrzej Siewior authored and Thomas Gleixner committed May 26, 2017
1 parent c5a81c8 commit 547efea
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions arch/x86/kernel/cpu/mtrr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,8 @@ void mtrr_save_state(void)
if (!mtrr_enabled())
return;

get_online_cpus();
first_cpu = cpumask_first(cpu_online_mask);
smp_call_function_single(first_cpu, mtrr_save_fixed_ranges, NULL, 1);
put_online_cpus();
}

void set_mtrr_aps_delayed_init(void)
Expand Down

0 comments on commit 547efea

Please sign in to comment.