瀏覽代碼

x86-64: Move isidle from PDA to per-cpu.

tj: s/isidle/is_idle/

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Brian Gerst 16 年之前
父節點
當前提交
c2558e0eba
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 0 1
      arch/x86/include/asm/pda.h
  2. 3 2
      arch/x86/kernel/process_64.c

+ 0 - 1
arch/x86/include/asm/pda.h

@@ -23,7 +23,6 @@ struct x8664_pda {
 					   offset 40!!! */
 					   offset 40!!! */
 #endif
 #endif
 	short in_bootmem;		/* pda lives in bootmem */
 	short in_bootmem;		/* pda lives in bootmem */
-	short isidle;
 } ____cacheline_aligned_in_smp;
 } ____cacheline_aligned_in_smp;
 
 
 DECLARE_PER_CPU(struct x8664_pda, __pda);
 DECLARE_PER_CPU(struct x8664_pda, __pda);

+ 3 - 2
arch/x86/kernel/process_64.c

@@ -61,6 +61,7 @@ DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
 EXPORT_PER_CPU_SYMBOL(current_task);
 EXPORT_PER_CPU_SYMBOL(current_task);
 
 
 DEFINE_PER_CPU(unsigned long, old_rsp);
 DEFINE_PER_CPU(unsigned long, old_rsp);
+static DEFINE_PER_CPU(unsigned char, is_idle);
 
 
 unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
 unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
 
 
@@ -80,13 +81,13 @@ EXPORT_SYMBOL_GPL(idle_notifier_unregister);
 
 
 void enter_idle(void)
 void enter_idle(void)
 {
 {
-	write_pda(isidle, 1);
+	percpu_write(is_idle, 1);
 	atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
 	atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
 }
 }
 
 
 static void __exit_idle(void)
 static void __exit_idle(void)
 {
 {
-	if (test_and_clear_bit_pda(0, isidle) == 0)
+	if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
 		return;
 		return;
 	atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
 	atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
 }
 }