[PATCH 5/8] NR_CPUS: Replace per_cpu(..., smp_processor_id()) with __get_cpu_var

From: Mike Travis
Date: Fri Jul 18 2008 - 21:13:00 EST


* Slight optimization when getting one's own cpu_info percpu data.

Applies to both tip/master and linux-next.

Signed-off-by: Mike Travis <travis@xxxxxxx>
---
include/asm-x86/processor.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.tip.orig/include/asm-x86/processor.h
+++ linux-2.6.tip/include/asm-x86/processor.h
@@ -135,7 +135,7 @@ extern __u32 cleared_cpu_caps[NCAPINTS
#ifdef CONFIG_SMP
DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info);
#define cpu_data(cpu) per_cpu(cpu_info, cpu)
-#define current_cpu_data cpu_data(smp_processor_id())
+#define current_cpu_data __get_cpu_var(cpu_info)
#else
#define cpu_data(cpu) boot_cpu_data
#define current_cpu_data boot_cpu_data

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/