From: Peter Zijlstra Date: Thu, 16 Sep 2010 17:21:28 +0000 (+0200) Subject: percpu: Add {get,put}_cpu_ptr X-Git-Tag: v2.6.37-rc1~214^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b8e2ec1eeca7f6941bc81cefc9663018d6ceb57;p=platform%2Fupstream%2Fkernel-adaptation-pc.git percpu: Add {get,put}_cpu_ptr These are similar to {get,put}_cpu_var() except for dynamically allocated per-cpu memory. Signed-off-by: Peter Zijlstra Acked-by: Tejun Heo LKML-Reference: <20100917093009.252867712@chello.nl> Signed-off-by: Ingo Molnar --- diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 49466b1..0eb5083 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -39,6 +39,15 @@ preempt_enable(); \ } while (0) +#define get_cpu_ptr(var) ({ \ + preempt_disable(); \ + this_cpu_ptr(var); }) + +#define put_cpu_ptr(var) do { \ + (void)(var); \ + preempt_enable(); \ +} while (0) + #ifdef CONFIG_SMP /* minimum unit size, also is the maximum supported allocation size */