diff options
author | Jan Beulich <JBeulich@suse.com> | 2012-03-23 18:01:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:31 -0400 |
commit | 7ccaba5314caf3a2b1052edb3146ccc969b4d466 (patch) | |
tree | b2d2c6a0c188794bf334b163bd89d827c84c1462 | |
parent | 10db4e1e4e9a910a26b94045660e5ba7e7c71419 (diff) |
consolidate WARN_...ONCE() static variables
Due to the alignment of following variables, these typically consume
more than just the single byte that 'bool' requires, and as there are a
few hundred instances, the cache pollution (not so much the waste of
memory) sums up. Put these variables into their own section, outside of
any half way frequently used memory range.
Do the same also to the __warned variable of rcu_lockdep_assert().
(Don't, however, include the ones used by printk_once() and alike, as
they can potentially be hot.)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/asm-generic/bug.h | 6 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 1 | ||||
-rw-r--r-- | include/linux/rcupdate.h | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 84458b0c38d1..2520a6e241dc 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -134,7 +134,7 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
134 | #endif | 134 | #endif |
135 | 135 | ||
136 | #define WARN_ON_ONCE(condition) ({ \ | 136 | #define WARN_ON_ONCE(condition) ({ \ |
137 | static bool __warned; \ | 137 | static bool __section(.data.unlikely) __warned; \ |
138 | int __ret_warn_once = !!(condition); \ | 138 | int __ret_warn_once = !!(condition); \ |
139 | \ | 139 | \ |
140 | if (unlikely(__ret_warn_once)) \ | 140 | if (unlikely(__ret_warn_once)) \ |
@@ -144,7 +144,7 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
144 | }) | 144 | }) |
145 | 145 | ||
146 | #define WARN_ONCE(condition, format...) ({ \ | 146 | #define WARN_ONCE(condition, format...) ({ \ |
147 | static bool __warned; \ | 147 | static bool __section(.data.unlikely) __warned; \ |
148 | int __ret_warn_once = !!(condition); \ | 148 | int __ret_warn_once = !!(condition); \ |
149 | \ | 149 | \ |
150 | if (unlikely(__ret_warn_once)) \ | 150 | if (unlikely(__ret_warn_once)) \ |
@@ -154,7 +154,7 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
154 | }) | 154 | }) |
155 | 155 | ||
156 | #define WARN_TAINT_ONCE(condition, taint, format...) ({ \ | 156 | #define WARN_TAINT_ONCE(condition, taint, format...) ({ \ |
157 | static bool __warned; \ | 157 | static bool __section(.data.unlikely) __warned; \ |
158 | int __ret_warn_once = !!(condition); \ | 158 | int __ret_warn_once = !!(condition); \ |
159 | \ | 159 | \ |
160 | if (unlikely(__ret_warn_once)) \ | 160 | if (unlikely(__ret_warn_once)) \ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b5e2e4c6b017..798603e8ec38 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -167,6 +167,7 @@ | |||
167 | CPU_KEEP(exit.data) \ | 167 | CPU_KEEP(exit.data) \ |
168 | MEM_KEEP(init.data) \ | 168 | MEM_KEEP(init.data) \ |
169 | MEM_KEEP(exit.data) \ | 169 | MEM_KEEP(exit.data) \ |
170 | *(.data.unlikely) \ | ||
170 | STRUCT_ALIGN(); \ | 171 | STRUCT_ALIGN(); \ |
171 | *(__tracepoints) \ | 172 | *(__tracepoints) \ |
172 | /* implement dynamic printk debug */ \ | 173 | /* implement dynamic printk debug */ \ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 937217425c47..2c62594b67dd 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -418,7 +418,7 @@ extern int rcu_my_thread_group_empty(void); | |||
418 | */ | 418 | */ |
419 | #define rcu_lockdep_assert(c, s) \ | 419 | #define rcu_lockdep_assert(c, s) \ |
420 | do { \ | 420 | do { \ |
421 | static bool __warned; \ | 421 | static bool __section(.data.unlikely) __warned; \ |
422 | if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ | 422 | if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ |
423 | __warned = true; \ | 423 | __warned = true; \ |
424 | lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ | 424 | lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ |