Thomas Gleixner
d10ef6f938
cpu/hotplug: Document states better
...
Requested-by: Peter Zijlstra <peterz@infradead.org >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-12 20:57:38 +01:00
Thomas Gleixner
2a58c527bb
cpu/hotplug: Fix smpboot thread ordering
...
Commit 931ef16330 moved the smpboot thread park/unpark invocation to the
state machine. The move of the unpark invocation was premature as it depends
on work in progress patches.
As a result cpu down can fail, because rcu synchronization in takedown_cpu()
eventually requires a functional softirq thread. I never encountered the
problem in testing, but 0day testing managed to provide a reliable reproducer.
Remove the smpboot_threads_park() call from the state machine for now and put
it back into the original place after the rcu synchronization.
I'm embarrassed as I knew about the dependency and still managed to get it
wrong. Hotplug induced brain melt seems to be the only sensible explanation
for that.
Fixes: 931ef16330 "cpu/hotplug: Unpark smpboot threads from the state machine"
Reported-by: Fengguang Wu <fengguang.wu@intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: Peter Zijlstra <peterz@infradead.org >
2016-03-10 21:21:59 +01:00
Thomas Gleixner
5d8eb84253
cpu/hotplug: Remove redundant state check
...
The check for the AP range in cpuhp_is_ap_state() is redundant after commit
8df3e07e7f "cpu/hotplug: Let upcoming cpu bring itself fully up" because all
states above CPUHP_BRINGUP_CPU are invoked on the hotplugged cpu. Remove it.
Reported-by: Richard Cochran <richardcochran@gmail.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-06 16:59:42 +01:00
Thomas Gleixner
71f87b2fc6
cpu/hotplug: Plug death reporting race
...
Paul noticed that the conversion of the death reporting introduced a race
where the outgoing cpu might be delayed after waking the controll processor,
so it might not be able to call rcu_report_dead() before being physically
removed, leading to RCU stalls.
We cant call complete after rcu_report_dead(), so instead of going back to
busy polling, simply issue a function call to do the completion.
Fixes: 27d50c7eeb "rcu: Make CPU_DYING_IDLE an explicit call"
Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com >
Link: http://lkml.kernel.org/r/20160302201127.GA23440@linux.vnet.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Acked-by: Peter Zijlstra <peterz@infradead.org >
2016-03-03 10:52:10 +01:00
Thomas Gleixner
27d50c7eeb
rcu: Make CPU_DYING_IDLE an explicit call
...
Make the RCU CPU_DYING_IDLE callback an explicit function call, so it gets
invoked at the proper place.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.870167933@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:58 +01:00
Thomas Gleixner
e69aab1311
cpu/hotplug: Make wait for dead cpu completion based
...
Kill the busy spinning on the control side and just wait for the hotplugged
cpu to tell that it reached the dead state.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.776157858@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:58 +01:00
Thomas Gleixner
8df3e07e7f
cpu/hotplug: Let upcoming cpu bring itself fully up
...
Let the upcoming cpu kick the hotplug thread and let itself complete the
bringup. That way the controll side can just wait for the completion or later
when we made the hotplug machinery async not care at all.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.697655464@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:57 +01:00
Thomas Gleixner
1cf4f629d9
cpu/hotplug: Move online calls to hotplugged cpu
...
Let the hotplugged cpu invoke the setup/teardown callbacks
(CPU_ONLINE/CPU_DOWN_PREPARE) itself.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.536364371@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:57 +01:00
Thomas Gleixner
4cb28ced23
cpu/hotplug: Create hotplug threads
...
In order to let the hotplugged cpu take care of the setup/teardown, we need a
seperate hotplug thread.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.454541272@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:56 +01:00
Thomas Gleixner
2e1a3483ce
cpu/hotplug: Split out the state walk into functions
...
We need that for running callbacks on the AP and the BP.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.374946234@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:56 +01:00
Thomas Gleixner
931ef16330
cpu/hotplug: Unpark smpboot threads from the state machine
...
Handle the smpboot threads in the state machine.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.295777684@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:56 +01:00
Thomas Gleixner
949338e351
cpu/hotplug: Move scheduler cpu_online notifier to hotplug core
...
Move the scheduler cpu online notifier part to the hotplug core. This is
anyway the highest priority callback and we need that functionality right now
for the next changes.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.200791046@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:55 +01:00
Thomas Gleixner
5b7aa87e04
cpu/hotplug: Implement setup/removal interface
...
Implement function which allow to setup/remove hotplug state callbacks.
The default behaviour for setup is to call the startup function for this state
for (or on) all cpus which have a hotplug state >= the installed state.
The default behaviour for removal is to call the teardown function for this
state for (or on) all cpus which have a hotplug state >= the installed state.
This includes rollback to the previous state in case of failure.
A special state is CPUHP_ONLINE_DYN. Its for dynamically registering a hotplug
callback pair. This is for drivers which have no dependencies to avoid that we
need to allocate CPUHP states for each of them
For both setup and remove helper functions are provided, which prevent the
core to issue the callbacks. This simplifies the conversion of existing
hotplug notifiers.
[ Dynamic registering implemented by Sebastian Siewior ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.103464877@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:55 +01:00
Thomas Gleixner
757c989b99
cpu/hotplug: Make target state writeable
...
Make it possible to write a target state to the per cpu state file, so we can
switch between states.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182341.022814799@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:55 +01:00
Thomas Gleixner
98f8cdce1d
cpu/hotplug: Add sysfs state interface
...
Add a sysfs interface so we can actually see in which state the cpus are in.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.942257522@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:55 +01:00
Thomas Gleixner
af1f40457d
cpu/hotplug: Hand in target state to _cpu_up/down
...
We want to be able to bringup/teardown the cpu to a particular state. Add a
target argument to _cpu_up/down.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.862113133@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:54 +01:00
Thomas Gleixner
4baa0afc67
cpu/hotplug: Convert the hotplugged cpu work to a state machine
...
Move the functions which need to run on the hotplugged processor into
a state machine array and let the code iterate through these functions.
In a later state, this will grow synchronization points between the
control processor and the hotplugged processor, so we can move the
various architecture implementations of the synchronizations to the
core.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.770651526@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:54 +01:00
Thomas Gleixner
cff7d378d3
cpu/hotplug: Convert to a state machine for the control processor
...
Move the split out steps into a callback array and let the cpu_up/down
code iterate through the array functions. For now most of the
callbacks are asymmetric to resemble the current hotplug maze.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.671816690@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:54 +01:00
Thomas Gleixner
984581728e
cpu/hotplug: Split out cpu down functions
...
Split cpu_down in separate functions in preparation for state machine
conversion.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.511796562@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:53 +01:00
Thomas Gleixner
ba99746243
cpu/hotplug: Restructure cpu_up code
...
Split out into separate functions, so we can convert it to a state machine.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.429389195@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:53 +01:00
Thomas Gleixner
090e77c391
cpu/hotplug: Restructure FROZEN state handling
...
There are only a few callbacks which really care about FROZEN
vs. !FROZEN. No need to have extra states for this.
Publish the frozen state in an extra variable which is updated under
the hotplug lock and let the users interested deal with it w/o
imposing that extra state checks on everyone.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: linux-arch@vger.kernel.org
Cc: Rik van Riel <riel@redhat.com >
Cc: Rafael Wysocki <rafael.j.wysocki@intel.com >
Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Sebastian Siewior <bigeasy@linutronix.de >
Cc: Rusty Russell <rusty@rustcorp.com.au >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Oleg Nesterov <oleg@redhat.com >
Cc: Tejun Heo <tj@kernel.org >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Paul Turner <pjt@google.com >
Link: http://lkml.kernel.org/r/20160226182340.334912357@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2016-03-01 20:36:53 +01:00
Rasmus Villemoes
9425676a36
kernel/cpu.c: make set_cpu_* static inlines
...
Almost all callers of the set_cpu_* functions pass an explicit true or
false. Making them static inline thus replaces the function calls with a
simple set_bit/clear_bit, saving some .text.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Acked-by: Rusty Russell <rusty@rustcorp.com.au >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-01-20 17:09:18 -08:00
Rasmus Villemoes
5aec01b834
kernel/cpu.c: eliminate cpu_*_mask
...
Replace the variables cpu_possible_mask, cpu_online_mask, cpu_present_mask
and cpu_active_mask with macros expanding to expressions of the same type
and value, eliminating some indirection.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Acked-by: Rusty Russell <rusty@rustcorp.com.au >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-01-20 17:09:18 -08:00
Rasmus Villemoes
4b804c85dc
kernel/cpu.c: export __cpu_*_mask
...
Exporting the cpumasks __cpu_possible_mask and friends will allow us to
remove the extra indirection through the cpu_*_mask variables. It will
also allow the set_cpu_* functions to become static inlines, which will
give a .text reduction.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Acked-by: Rusty Russell <rusty@rustcorp.com.au >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-01-20 17:09:18 -08:00
Rasmus Villemoes
c4c54dd1ca
kernel/cpu.c: change type of cpu_possible_bits and friends
...
Change cpu_possible_bits and friends (online, present, active) from being
bitmaps that happen to have the right size to actually being struct
cpumasks. Also rename them to __cpu_xyz_mask. This is mostly a small
cleanup in preparation for exporting them and, eventually, eliminating the
extra indirection through the cpu_xyz_mask variables.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Acked-by: Rusty Russell <rusty@rustcorp.com.au >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-01-20 17:09:18 -08:00