Skip to contentSkip to conversation

printk-add-printk_once_deferred.patch removed from -mm tree

to-be-updated [email protected] 1 participant 1 message May 5, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Subject: [to-be-updated] printk-add-printk_once_deferred.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 05 May 2014 15:05:02 -0700

The patch titled
Subject: printk: add printk_once_deferred()
has been removed from the -mm tree. Its filename was
printk-add-printk_once_deferred.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: John Stultz <[email protected]>
Subject: printk: add printk_once_deferred()

Two of the three prink_deferred uses are really printk_once style uses, so add a printk_once_deferred macro to simplify those call sites.

Cc Jan Kara <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Jiri Bohac <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Steven Rostedt <[email protected]>

---

 include/linux/printk.h  |   11 +++++++++++
 kernel/sched/deadline.c |    7 +------
 kernel/sched/rt.c       |    8 +-------
 3 files changed, 13 insertions(+), 13 deletions(-)
include/linux/printk.h renamed from include/linux/printk.h~printk-add-printk_once_deferred +11 -0
diff -puN include/linux/printk.h~printk-add-printk_once_deferred include/linux/printk.h
@@ -266,9 +266,20 @@ extern asmlinkage void dump_stack(void)
 		printk(fmt, ##__VA_ARGS__);			\
 	}							\
 })
+#define printk_once_deferred(fmt, ...)				\
+({								\
+	static bool __print_once __read_mostly;			\
+								\
+	if (!__print_once) {					\
+		__print_once = true;				\
+		printk_deferred(fmt, ##__VA_ARGS__);		\
+	}							\
+})
 #else
 #define printk_once(fmt, ...)					\
 	no_printk(fmt, ##__VA_ARGS__)
+#define printk_once_deferred(fmt, ...)				\
+	no_printk(fmt, ##__VA_ARGS__)
 #endif
 
 #define pr_emerg_once(fmt, ...)					\
kernel/sched/deadline.c renamed from kernel/sched/deadline.c~printk-add-printk_once_deferred +1 -6
diff -puN kernel/sched/deadline.c~printk-add-printk_once_deferred kernel/sched/deadline.c
@@ -348,12 +348,7 @@ static void replenish_dl_entity(struct s
 	 * entity.
 	 */
 	if (dl_time_before(dl_se->deadline, rq_clock(rq))) {
-		static bool lag_once = false;
-
-		if (!lag_once) {
-			lag_once = true;
-			printk_deferred("sched: DL replenish lagged to much\n");
-		}
+		printk_once_deferred("sched: DL replenish lagged to much\n");
 		dl_se->deadline = rq_clock(rq) + pi_se->dl_deadline;
 		dl_se->runtime = pi_se->dl_runtime;
 	}
kernel/sched/rt.c renamed from kernel/sched/rt.c~printk-add-printk_once_deferred +0 -2
diff -puN kernel/sched/rt.c~printk-add-printk_once_deferred kernel/sched/rt.c
@@ -851,14 +851,8 @@ static int sched_rt_runtime_exceeded(str
 		 * but accrue some time due to boosting.
 		 */
 		if (likely(rt_b->rt_runtime)) {
-			static bool once = false;
-
 			rt_rq->rt_throttled = 1;