diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-09-16 13:21:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-21 07:55:43 -0400 |
commit | 8b8e2ec1eeca7f6941bc81cefc9663018d6ceb57 (patch) | |
tree | fbbfa0732aceb7204f1f962e004ea192e7b7d833 /include/linux/percpu.h | |
parent | 7ed569206ebe7467b9c912b857ec46cf1c361111 (diff) |
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 <a.p.zijlstra@chello.nl>
Acked-by: Tejun Heo <tj@kernel.org>
LKML-Reference: <20100917093009.252867712@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/percpu.h')
-rw-r--r-- | include/linux/percpu.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 49466b13c5c6..0eb50832aa00 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -39,6 +39,15 @@ | |||
39 | preempt_enable(); \ | 39 | preempt_enable(); \ |
40 | } while (0) | 40 | } while (0) |
41 | 41 | ||
42 | #define get_cpu_ptr(var) ({ \ | ||
43 | preempt_disable(); \ | ||
44 | this_cpu_ptr(var); }) | ||
45 | |||
46 | #define put_cpu_ptr(var) do { \ | ||
47 | (void)(var); \ | ||
48 | preempt_enable(); \ | ||
49 | } while (0) | ||
50 | |||
42 | #ifdef CONFIG_SMP | 51 | #ifdef CONFIG_SMP |
43 | 52 | ||
44 | /* minimum unit size, also is the maximum supported allocation size */ | 53 | /* minimum unit size, also is the maximum supported allocation size */ |