aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/percpu.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-07-13 18:17:28 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-07-13 18:17:28 +0100
commitddf3a0035f8bf9018cf1577826e0d35a6829e3a1 (patch)
treefda21bee0ae920e2d6ad1a8db42029620da5584d /xen/include/asm-x86/percpu.h
parentd0a3c6c7a14fc7f8ed4007656dcc4f0ad0a6f030 (diff)
downloadxen-ddf3a0035f8bf9018cf1577826e0d35a6829e3a1.tar.gz
xen-ddf3a0035f8bf9018cf1577826e0d35a6829e3a1.tar.bz2
xen-ddf3a0035f8bf9018cf1577826e0d35a6829e3a1.zip
x86: optimize this_cpu()
Besides the .text space savings of over 2.5k on x86-64 (1.5k for x86-32) this removes a load (plus a lea on x86-64) from various frequently executed code paths, and finally provides a reason (other than legibility) to prefer this_cpu() over per_cpu() in all places where smp_processor_id() isn't being called anyway. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/include/asm-x86/percpu.h')
-rw-r--r--xen/include/asm-x86/percpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/include/asm-x86/percpu.h b/xen/include/asm-x86/percpu.h
index fb1d4140ec..e6faa8ce07 100644
--- a/xen/include/asm-x86/percpu.h
+++ b/xen/include/asm-x86/percpu.h
@@ -16,7 +16,7 @@ void percpu_init_areas(void);
#define per_cpu(var, cpu) \
(*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
#define __get_cpu_var(var) \
- (per_cpu(var, smp_processor_id()))
+ (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name