Skip to contentSkip to conversation

+ printk-mark-printk_once-test-variable-__read_mostly.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Oct 7, 2013 Printk

lore
Share & tools
lore
#0 lore raw

Subject: + printk-mark-printk_once-test-variable-__read_mostly.patch added to -mm tree
To: [email protected]
From: [email protected]
Date: Mon, 07 Oct 2013 16:44:14 -0700

The patch titled
Subject: printk: mark printk_once test variable __read_mostly
has been added to the -mm tree. Its filename is
printk-mark-printk_once-test-variable-__read_mostly.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/printk-mark-printk_once-test-variable-__read_mostly.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/printk-mark-printk_once-test-variable-__read_mostly.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: printk: mark printk_once test variable __read_mostly

It's only set once so mark it __read_mostly.

Neaten the alignment so it matches the rest of the pr_<level>_once #defines too.

---

 include/linux/printk.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/linux/printk.h renamed from include/linux/printk.h~printk-mark-printk_once-test-variable-__read_mostly +9 -9
diff -puN include/linux/printk.h~printk-mark-printk_once-test-variable-__read_mostly include/linux/printk.h
@@ -251,17 +251,17 @@ extern asmlinkage void dump_stack(void)
  */
 
 #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
 

_

Patches currently in -mm which might be from [email protected] are

kernel-timerc-convert-kmalloc_nodegfp_zero-to-kzalloc_node.patch ksm-remove-redundant-__gfp_zero-from-kcalloc.patch printk-report-console-names-during-cut-over.patch kernel-printk-printkc-convert-to-pr_foo.patch printk-mark-printk_once-test-variable-__read_mostly.patch checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch checkpatch-extend-camelcase-types-and-ignore-existing-camelcase-uses-in-a-patch.patch checkpatch-update-seq_foo-tests.patch checkpatch-find-camelcase-definitions-of-struct-union-enum.patch checkpatch-add-test-for-defines-of-arch_has_foo.patch checkpatch-add-rules-to-check-init-attribute-and-const-defects.patch checkpatch-make-the-memory-barrier-test-noisier.patch checkpatchpl-check-for-the-fsf-mailing-address.patch kernel-modulec-use-pr_foo.patch
linux-next.patch