summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-06-28 20:42:16 +0200
committerClark Williams <williams@redhat.com>2011-12-28 16:25:43 -0600
commita55fe21283d39b3ae46e4a904c7ff5d094a6d86f (patch)
treedc651ce738dc9e9b3a24e5d025eba7543e2f5e0b /include
parentdd3175db3335c41af5a52e4e718ba7199c3db114 (diff)
local-vars-migrate-disable.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/percpu.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 3941ea401f3d..58163cd6cca1 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -48,10 +48,30 @@
preempt_enable(); \
} while (0)
-#define get_local_var(var) get_cpu_var(var)
-#define put_local_var(var) put_cpu_var(var)
-#define get_local_ptr(var) get_cpu_ptr(var)
-#define put_local_ptr(var) put_cpu_ptr(var)
+#ifndef CONFIG_PREEMPT_RT_FULL
+# define get_local_var(var) get_cpu_var(var)
+# define put_local_var(var) put_cpu_var(var)
+# define get_local_ptr(var) get_cpu_ptr(var)
+# define put_local_ptr(var) put_cpu_ptr(var)
+#else
+# define get_local_var(var) (*({ \
+ migrate_disable(); \
+ &__get_cpu_var(var); }))
+
+# define put_local_var(var) do { \
+ (void)&(var); \
+ migrate_enable(); \
+} while (0)
+
+# define get_local_ptr(var) ({ \
+ migrate_disable(); \
+ this_cpu_ptr(var); })
+
+# define put_local_ptr(var) do { \
+ (void)(var); \
+ migrate_enable(); \
+} while (0)
+#endif
/* minimum unit size, also is the maximum supported allocation size */
#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10)