Allocpercpu: Remove __percpu_disguise() function Disguising costs a few cycles in the hot paths and its optional anyways. So remove it. If its useful for debugging then we could retain it under CONFIG_DEBUG_VM? Signed-off-by: Christoph Lameter --- include/linux/percpu.h | 3 +-- mm/allocpercpu.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) Index: linux-2.6/include/linux/percpu.h =================================================================== --- linux-2.6.orig/include/linux/percpu.h 2007-10-31 14:22:11.201376723 -0700 +++ linux-2.6/include/linux/percpu.h 2007-10-31 14:27:12.574126419 -0700 @@ -33,7 +33,6 @@ #ifdef CONFIG_SMP -#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) /* * Use this to get to a cpu's version of the per-cpu object dynamically * allocated. Non-atomic access to the current CPU's version should @@ -41,7 +40,7 @@ */ #define percpu_ptr(ptr, cpu) \ ({ \ - void *p = __percpu_disguise(ptr); \ + void *p = ptr; \ unsigned long q = per_cpu_offset(cpu); \ (__typeof__(ptr))(p + q); \ }) Index: linux-2.6/mm/allocpercpu.c =================================================================== --- linux-2.6.orig/mm/allocpercpu.c 2007-10-31 14:21:12.905127138 -0700 +++ linux-2.6/mm/allocpercpu.c 2007-10-31 14:27:12.578126588 -0700 @@ -143,7 +143,7 @@ static inline void cpu_free(void *pcpu) void *__alloc_percpu(size_t size) { void *pdata = cpu_alloc(size); - void *__pdata = __percpu_disguise(pdata); + void *__pdata = pdata; int cpu; if (unlikely(!pdata)) @@ -164,7 +164,7 @@ void percpu_free(void *__pdata) { if (unlikely(!__pdata)) return; - cpu_free(__percpu_disguise(__pdata)); + cpu_free(__pdata); } EXPORT_SYMBOL_GPL(percpu_free);