]> git.karo-electronics.de Git - karo-tx-linux.git/commit
stop_machine: make stop_machine safe and efficient to call early
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Wed, 5 Oct 2011 00:43:24 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 11 Oct 2011 08:43:59 +0000 (19:43 +1100)
commit779b459eda0ddf8d2138410fc065eb3640bf1569
tree293752102bd67c15ff5706960619e3ee94efc8ae
parentc32b41ddfabd21ed92c25cd0d82ca5e66b469a4a
stop_machine: make stop_machine safe and efficient to call early

Make stop_machine() safe to call early in boot, before SMP has been set
up, by simply calling the callback function directly if there's only one
CPU online.

[ Fixes from AKPM:
   - add comment
   - local_irq_flags, not save_flags
   - also call hard_irq_disable() for systems which need it

  Tejun suggested using an explicit flag rather than just looking at
  the online cpu count. ]

Cc: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Andrew Morton <akpm@google.com>
kernel/stop_machine.c