Skip to content

Commit

Permalink
powerpc/powernv: Use stop_machine_cpuslocked()
Browse files Browse the repository at this point in the history
set_subcores_per_core() holds get_online_cpus() while invoking stop_machine().

stop_machine() invokes get_online_cpus() as well. This is correct, but
prevents the conversion of the hotplug locking to a percpu rwsem.

Use stop_machine_cpuslocked() to avoid the nested call. Convert
*_online_cpus() to the new interfaces while at it.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
  • Loading branch information
Sebastian Andrzej Siewior authored and KAGA-KOKO committed May 26, 2017
1 parent 2337e87 commit f9a6993
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/powerpc/platforms/powernv/subcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,18 @@ static int set_subcores_per_core(int new_mode)
state->master = 0;
}

get_online_cpus();
cpus_read_lock();

/* This cpu will update the globals before exiting stop machine */
this_cpu_ptr(&split_state)->master = 1;

/* Ensure state is consistent before we call the other cpus */
mb();

stop_machine(cpu_update_split_mode, &new_mode, cpu_online_mask);
stop_machine_cpuslocked(cpu_update_split_mode, &new_mode,
cpu_online_mask);

put_online_cpus();
cpus_read_unlock();

return 0;
}
Expand Down

0 comments on commit f9a6993

Please sign in to comment.