aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-09-03 17:31:44 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-04 01:10:31 -0400
commit53f824520b6d84ca5b4a8fd71addc91dbf64357e (patch)
treefc62733de8040f13cf450b6cae967976da31827b /include
parent1ea0d14e480c245683927eecc03a70faf06e80c8 (diff)
x86/i386: Put aligned stack-canary in percpu shared_aligned section
Pack aligned things together into a special section to minimize padding holes. Suggested-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Tejun Heo <tj@kernel.org> LKML-Reference: <4AA035C0.9070202@goop.org> [ queued up in tip:x86/asm because it depends on this commit: x86/i386: Make sure stack-protector segment base is cache aligned ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/percpu.h3
-rw-r--r--include/linux/percpu-defs.h8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index aa00800adacc..90079c373f1c 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -81,14 +81,17 @@ extern void setup_per_cpu_areas(void);
81 81
82#ifdef MODULE 82#ifdef MODULE
83#define PER_CPU_SHARED_ALIGNED_SECTION "" 83#define PER_CPU_SHARED_ALIGNED_SECTION ""
84#define PER_CPU_ALIGNED_SECTION ""
84#else 85#else
85#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" 86#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
87#define PER_CPU_ALIGNED_SECTION ".shared_aligned"
86#endif 88#endif
87#define PER_CPU_FIRST_SECTION ".first" 89#define PER_CPU_FIRST_SECTION ".first"
88 90
89#else 91#else
90 92
91#define PER_CPU_SHARED_ALIGNED_SECTION "" 93#define PER_CPU_SHARED_ALIGNED_SECTION ""
94#define PER_CPU_ALIGNED_SECTION ".shared_aligned"
92#define PER_CPU_FIRST_SECTION "" 95#define PER_CPU_FIRST_SECTION ""
93 96
94#endif 97#endif
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 68438e18fff4..3058cf9dd3d4 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -66,6 +66,14 @@
66 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ 66 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
67 ____cacheline_aligned_in_smp 67 ____cacheline_aligned_in_smp
68 68
69#define DECLARE_PER_CPU_ALIGNED(type, name) \
70 DECLARE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \
71 ____cacheline_aligned
72
73#define DEFINE_PER_CPU_ALIGNED(type, name) \
74 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \
75 ____cacheline_aligned
76
69/* 77/*
70 * Declaration/definition used for per-CPU variables that must be page aligned. 78 * Declaration/definition used for per-CPU variables that must be page aligned.
71 */ 79 */