提交 ee74d132 编写于 作者: S Srivatsa S. Bhat 提交者: Thomas Gleixner

smpboot, idle: Optimize calls to smp_processor_id() in idle_threads_init()

While trying to initialize idle threads for all cpus, idle_threads_init()
calls smp_processor_id() in a loop, which is unnecessary. The intent
is to initialize idle threads for all non-boot cpus. So just use a variable
to note the boot cpu and use it in the loop.
Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: suresh.b.siddha@intel.com
Cc: venki@google.com
Cc: nikunj@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/20120524151055.2549.64309.stgit@srivatsabhat.in.ibm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 f9369910
...@@ -52,10 +52,12 @@ static inline void idle_init(unsigned int cpu) ...@@ -52,10 +52,12 @@ static inline void idle_init(unsigned int cpu)
*/ */
void __init idle_threads_init(void) void __init idle_threads_init(void)
{ {
unsigned int cpu; unsigned int cpu, boot_cpu;
boot_cpu = smp_processor_id();
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
if (cpu != smp_processor_id()) if (cpu != boot_cpu)
idle_init(cpu); idle_init(cpu);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册