Commit 7ccaba53 authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

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: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 10db4e1e
...@@ -134,7 +134,7 @@ extern void warn_slowpath_null(const char *file, const int line); ...@@ -134,7 +134,7 @@ extern void warn_slowpath_null(const char *file, const int line);
#endif #endif
#define WARN_ON_ONCE(condition) ({ \ #define WARN_ON_ONCE(condition) ({ \
static bool __warned; \ static bool __section(.data.unlikely) __warned; \
int __ret_warn_once = !!(condition); \ int __ret_warn_once = !!(condition); \
\ \
if (unlikely(__ret_warn_once)) \ if (unlikely(__ret_warn_once)) \
...@@ -144,7 +144,7 @@ extern void warn_slowpath_null(const char *file, const int line); ...@@ -144,7 +144,7 @@ extern void warn_slowpath_null(const char *file, const int line);
}) })
#define WARN_ONCE(condition, format...) ({ \ #define WARN_ONCE(condition, format...) ({ \
static bool __warned; \ static bool __section(.data.unlikely) __warned; \
int __ret_warn_once = !!(condition); \ int __ret_warn_once = !!(condition); \
\ \
if (unlikely(__ret_warn_once)) \ if (unlikely(__ret_warn_once)) \
...@@ -154,7 +154,7 @@ extern void warn_slowpath_null(const char *file, const int line); ...@@ -154,7 +154,7 @@ extern void warn_slowpath_null(const char *file, const int line);
}) })
#define WARN_TAINT_ONCE(condition, taint, format...) ({ \ #define WARN_TAINT_ONCE(condition, taint, format...) ({ \
static bool __warned; \ static bool __section(.data.unlikely) __warned; \
int __ret_warn_once = !!(condition); \ int __ret_warn_once = !!(condition); \
\ \
if (unlikely(__ret_warn_once)) \ if (unlikely(__ret_warn_once)) \
......
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
CPU_KEEP(exit.data) \ CPU_KEEP(exit.data) \
MEM_KEEP(init.data) \ MEM_KEEP(init.data) \
MEM_KEEP(exit.data) \ MEM_KEEP(exit.data) \
*(.data.unlikely) \
STRUCT_ALIGN(); \ STRUCT_ALIGN(); \
*(__tracepoints) \ *(__tracepoints) \
/* implement dynamic printk debug */ \ /* implement dynamic printk debug */ \
......
...@@ -418,7 +418,7 @@ extern int rcu_my_thread_group_empty(void); ...@@ -418,7 +418,7 @@ extern int rcu_my_thread_group_empty(void);
*/ */
#define rcu_lockdep_assert(c, s) \ #define rcu_lockdep_assert(c, s) \
do { \ do { \
static bool __warned; \ static bool __section(.data.unlikely) __warned; \
if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
__warned = true; \ __warned = true; \
lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ lockdep_rcu_suspicious(__FILE__, __LINE__, s); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment