--- include/asm-x86/page_64.h | 1 + include/asm-x86/percpu_64.h | 22 ++++++---------------- include/asm-x86/pgtable_64.h | 1 - include/linux/vmstat.h | 10 ++++------ 4 files changed, 11 insertions(+), 23 deletions(-) Index: linux-2.6/include/linux/vmstat.h =================================================================== --- linux-2.6.orig/include/linux/vmstat.h 2007-11-17 23:53:15.854836588 -0800 +++ linux-2.6/include/linux/vmstat.h 2007-11-18 09:18:02.734533142 -0800 @@ -59,24 +59,22 @@ DECLARE_PER_CPU(struct vm_event_state, v static inline void __count_vm_event(enum vm_event_item item) { - __get_cpu_var(vm_event_states).event[item]++; + __CPU_INC(cpu_var_offset(vm_event_states).event[item]); } static inline void count_vm_event(enum vm_event_item item) { - get_cpu_var(vm_event_states).event[item]++; - put_cpu(); + _CPU_INC(cpu_var_offset(vm_event_states).event[item]); } static inline void __count_vm_events(enum vm_event_item item, long delta) { - __get_cpu_var(vm_event_states).event[item] += delta; + __CPU_ADD(cpu_var_offset(vm_event_states).event[item], delta); } static inline void count_vm_events(enum vm_event_item item, long delta) { - get_cpu_var(vm_event_states).event[item] += delta; - put_cpu(); + _CPU_ADD(cpu_var_offset(vm_event_states).event[item], delta); } extern void all_vm_events(unsigned long *); Index: linux-2.6/include/asm-x86/page_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/page_64.h 2007-11-18 00:17:31.271086449 -0800 +++ linux-2.6/include/asm-x86/page_64.h 2007-11-18 00:17:41.170086419 -0800 @@ -93,6 +93,7 @@ extern unsigned long phys_base; #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START) #define __START_KERNEL_map _AC(0xffffffff80000000, UL) #define __PAGE_OFFSET _AC(0xffff810000000000, UL) +#define CPU_AREA_BASE _AC(0xffffffff84000000, UL) /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) Index: linux-2.6/include/asm-x86/percpu_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/percpu_64.h 2007-11-18 00:04:46.622586873 -0800 +++ linux-2.6/include/asm-x86/percpu_64.h 2007-11-18 09:17:14.526739982 -0800 @@ -24,29 +24,19 @@ __attribute__((__section__(".data.percpu.first"))) \ __typeof__(type) per_cpu__##name -extern char __per_cpu_start[]; - -#define canonical(__p) \ - (__p - (unsigned long)__per_cpu_start) - - -#define PERCPU_PTR(__p, __cpu) ((__typeof__(__p))((void *)(__p) + \ - ((__cpu) << (CONFIG_CPU_AREA_ORDER + PAGE_SHIFT)))) - -#define THIS_PERCPU(__p) PERCPU_PTR(__p, smp_processor_id()) -#define __THIS_PERCPU(__p) PERCPU_PTR(__p, raw_smp_processor_id()) - - /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) (*({ \ extern int simple_identifier_##var(void); \ - PERCPU_PTR(&per_cpu__##var, cpu); })) + CPU_PTR(&per_cpu__##var, cpu); })) #define __get_cpu_var(var) (*({ \ extern int simple_identifier_##var(void); \ - THIS_PERCPU(&per_cpu__##var); })) + THIS_CPU(&per_cpu__##var); })) #define __raw_get_cpu_var(var) (*({ \ extern int simple_identifier_##var(void); \ - __THIS_PERCPU(&per_cpu__##var); })) + __THIS_CPU(&per_cpu__##var); })) +#define cpu_var_offset(var) (*({ \ + extern int simple_identifier_##var(void); \ + &per_cpu__##var; })) /* A macro to avoid #include hell... */ #define percpu_modcopy(pcpudst, src, size) \ Index: linux-2.6/include/asm-x86/pgtable_64.h =================================================================== --- linux-2.6.orig/include/asm-x86/pgtable_64.h 2007-11-18 00:17:16.799336740 -0800 +++ linux-2.6/include/asm-x86/pgtable_64.h 2007-11-18 00:17:23.198047130 -0800 @@ -138,7 +138,6 @@ static inline pte_t ptep_get_and_clear_f #define VMALLOC_START _AC(0xffffc20000000000, UL) #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) #define VMEMMAP_START _AC(0xffffe20000000000, UL) -#define CPU_AREA_BASE _AC(0xffffffff84000000, UL) #define MODULES_VADDR _AC(0xffffffff88000000, UL) #define MODULES_END _AC(0xfffffffffff00000, UL) #define MODULES_LEN (MODULES_END - MODULES_VADDR)