]> Pileus Git - ~andy/linux/blobdiff - include/linux/printk.h
printk/cache: mark printk_once test variable __read_mostly
[~andy/linux] / include / linux / printk.h
index 694925837a1645bb7297cc9254efee7173a32197..cc6f74d65167b47f4a59da3c8af04190329cf6f5 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/init.h>
 #include <linux/kern_levels.h>
 #include <linux/linkage.h>
+#include <linux/cache.h>
 
 extern const char linux_banner[];
 extern const char linux_proc_banner[];
@@ -253,17 +254,17 @@ extern asmlinkage void dump_stack(void) __cold;
  */
 
 #ifdef CONFIG_PRINTK
-#define printk_once(fmt, ...)                  \
-({                                             \
-       static bool __print_once;               \
-                                               \
-       if (!__print_once) {                    \
-               __print_once = true;            \
-               printk(fmt, ##__VA_ARGS__);     \
-       }                                       \
+#define printk_once(fmt, ...)                                  \
+({                                                             \
+       static bool __print_once __read_mostly;                 \
+                                                               \
+       if (!__print_once) {                                    \
+               __print_once = true;                            \
+               printk(fmt, ##__VA_ARGS__);                     \
+       }                                                       \
 })
 #else
-#define printk_once(fmt, ...)                  \
+#define printk_once(fmt, ...)                                  \
        no_printk(fmt, ##__VA_ARGS__)
 #endif