projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ed5692
)
percpu: Add {get,put}_cpu_ptr
author
Peter Zijlstra
<
[email protected]
>
Thu, 16 Sep 2010 17:21:28 +0000
(19:21 +0200)
committer
Ingo Molnar
<
[email protected]
>
Tue, 21 Sep 2010 11:55:43 +0000
(13:55 +0200)
These are similar to {get,put}_cpu_var() except for dynamically
allocated per-cpu memory.
Signed-off-by: Peter Zijlstra <
[email protected]
>
Acked-by: Tejun Heo <
[email protected]
>
LKML-Reference: <
20100917093009
.
252867712
@chello.nl>
Signed-off-by: Ingo Molnar <
[email protected]
>
include/linux/percpu.h
patch
|
blob
|
history
diff --git
a/include/linux/percpu.h
b/include/linux/percpu.h
index 49466b13c5c6b310f36b31c052573864df6f02a0..0eb50832aa00fd1bbc31cc23837abfc698412402 100644
(file)
--- 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 */