]> 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>
Fri, 7 Oct 2011 06:06:50 +0000 (17:06 +1100)
commitb1e561807500e142d05ead4fd9d1522ef0f3c68d
tree13f41f26f4679406c21290202bc6d39adbd19c66
parentd88d3bc3c6d02e4b2ae4b190727849b9974ac938
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