diff options
author | Tejun Heo <tj@kernel.org> | 2009-08-03 01:10:11 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-08-03 12:29:24 -0400 |
commit | 3e352aa8ee2bd48f1a19c7742810b3a4a7ba605e (patch) | |
tree | a90566108225efefb1aaedc425b8bdcb72b389df /include/linux/percpu-defs.h | |
parent | ed8d9adf357ec331603fa1049510399812cea7e5 (diff) |
x86, percpu: Fix DECLARE/DEFINE_PER_CPU_PAGE_ALIGNED()
DECLARE/DEFINE_PER_CPU_PAGE_ALIGNED() put percpu variables in
.page_aligned section without adding any alignment restrictions.
Currently, this doesn't cause any problem because all users of the
macros have explicit page alignment and page-sized but it's much safer
to enforce page alignment from the macros. After all, it's what they
claim to do.
Add __aligned(PAGE_SIZE) to DECLARE/DEFINE_PER_CPU_PAGE_ALIGNED() and
drop explicit alignment from it users.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/linux/percpu-defs.h')
-rw-r--r-- | include/linux/percpu-defs.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 68438e18fff4..afd5f8b7061f 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -69,11 +69,13 @@ | |||
69 | /* | 69 | /* |
70 | * Declaration/definition used for per-CPU variables that must be page aligned. | 70 | * Declaration/definition used for per-CPU variables that must be page aligned. |
71 | */ | 71 | */ |
72 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ | 72 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ |
73 | DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") | 73 | DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") \ |
74 | __aligned(PAGE_SIZE) | ||
74 | 75 | ||
75 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | 76 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ |
76 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") | 77 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") \ |
78 | __aligned(PAGE_SIZE) | ||
77 | 79 | ||
78 | /* | 80 | /* |
79 | * Intermodule exports for per-CPU variables. | 81 | * Intermodule exports for per-CPU variables. |