diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-28 20:42:16 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-04-10 16:40:45 -0500 |
commit | 15808f613075c2d0393ee667678501e48287f60e (patch) | |
tree | 6c8556f8e856dd800f433f39a061eb5b5c7151f3 /include | |
parent | df3c1138949e12e79a162eea2f0b04cbed73203a (diff) |
local-vars-migrate-disable.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/percpu.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 3d13ce03219f..5a56f18345df 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) |