50 lines
1.5 KiB
Diff
50 lines
1.5 KiB
Diff
Subject: local-vars-migrate-disable.patch
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Tue, 28 Jun 2011 20:42:16 +0200
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/3.10/patches-3.10.4-rt1.tar.xz
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
---
|
|
include/linux/percpu.h | 28 ++++++++++++++++++++++++----
|
|
1 file changed, 24 insertions(+), 4 deletions(-)
|
|
|
|
Index: linux-stable/include/linux/percpu.h
|
|
===================================================================
|
|
--- linux-stable.orig/include/linux/percpu.h
|
|
+++ linux-stable/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)
|