+ printk-add-printk_once_deferred.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: + printk-add-printk_once_deferred.patch added to -mm tree
To: john.stultz@xxxxxxxxxx,jack@xxxxxxx,jbohac@xxxxxxx,mingo@xxxxxxxxxx,peterz@xxxxxxxxxxxxx,rostedt@xxxxxxxxxxx,tglx@xxxxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Fri, 02 May 2014 16:05:57 -0700


The patch titled
     Subject: printk: add printk_once_deferred()
has been added to the -mm tree.  Its filename is
     printk-add-printk_once_deferred.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/printk-add-printk_once_deferred.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/printk-add-printk_once_deferred.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: John Stultz <john.stultz@xxxxxxxxxx>
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.

Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Jiri Bohac <jbohac@xxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/printk.h  |   11 +++++++++++
 kernel/sched/deadline.c |    7 +------
 kernel/sched/rt.c       |    8 +-------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff -puN include/linux/printk.h~printk-add-printk_once_deferred include/linux/printk.h
--- a/include/linux/printk.h~printk-add-printk_once_deferred
+++ a/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, ...)					\
diff -puN kernel/sched/deadline.c~printk-add-printk_once_deferred kernel/sched/deadline.c
--- a/kernel/sched/deadline.c~printk-add-printk_once_deferred
+++ a/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;
 	}
diff -puN kernel/sched/rt.c~printk-add-printk_once_deferred kernel/sched/rt.c
--- a/kernel/sched/rt.c~printk-add-printk_once_deferred
+++ a/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;
-
-			if (!once) {
-				once = true;
-				printk_deferred("sched: RT throttling activated\n");
-			}
+			printk_once_deferred("sched: RT throttling activated\n");
 		} else {
 			/*
 			 * In case we did anyway, make it go away,
_

Patches currently in -mm which might be from john.stultz@xxxxxxxxxx are

printk-re-add-irqsave-restore-in-printk_sched.patch
printk-rename-printk_sched-to-printk_deferred.patch
printk-add-printk_once_deferred.patch
timekeeping-use-printk_deferred-when-holding-timekeeping-seqlock.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux