From patchwork Fri May 2 22:09:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 29602 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 24184206A5 for ; Fri, 2 May 2014 22:09:37 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf27214148iec.3 for ; Fri, 02 May 2014 15:09:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=/uoiOk04iG4DlzvcbjRE+bVFBJmDTB3Q4XAJGn9y9Z8=; b=PqxYr+/akpK3JfRKhfTZI7lBzRXtIZ2Q49QUPlwXqRE+Jt42UJRi/r/5Awr7emRQBu aQ0wsxafAApPdCTJvT2NVx1Wdp/YU0cGDP9f9o0ajAlmkQ8VJa2nsHXZxoCYaXFRZtdw xaNgDqSof2/W/Vxbv1CtOnHwKZtaQJezMAPHjaW7apX+5sO8P/Vp5fFcX1fwUaoAsZvA ETlB4x4eS2qYkWF5awvsD2sAqX5VF3csadoju+DHBlheGl+uy7N+CThmnkqQp7euCQdi XOC4eONQSqsayjn5fR5BaRC++hznNE1s5qJSMRmiH4UdYdQBaTNCyaJYR4cT4PUbkXKS JiQw== X-Gm-Message-State: ALoCoQl0z/HqeOMfwBkOT5E6ZPycZkvQM/c8spxKlgCFJkXTV0b9FfLSxebAwnybkahcXUJ0zaVm X-Received: by 10.43.31.81 with SMTP id sf17mr9212027icb.4.1399068576608; Fri, 02 May 2014 15:09:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.78 with SMTP id z72ls1697400qge.37.gmail; Fri, 02 May 2014 15:09:36 -0700 (PDT) X-Received: by 10.220.249.6 with SMTP id mi6mr1431128vcb.33.1399068576407; Fri, 02 May 2014 15:09:36 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id gx4si60194vcb.109.2014.05.02.15.09.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 15:09:36 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so5949802veb.19 for ; Fri, 02 May 2014 15:09:36 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr14690391vcb.19.1399068576337; Fri, 02 May 2014 15:09:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp134366vcb; Fri, 2 May 2014 15:09:35 -0700 (PDT) X-Received: by 10.66.142.73 with SMTP id ru9mr9495744pab.41.1399068575014; Fri, 02 May 2014 15:09:35 -0700 (PDT) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id sf3si222073pac.452.2014.05.02.15.09.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 15:09:34 -0700 (PDT) Received-SPF: none (google.com: john.stultz@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.41; Received: by mail-pa0-f41.google.com with SMTP id lj1so3390382pab.28 for ; Fri, 02 May 2014 15:09:34 -0700 (PDT) X-Received: by 10.66.240.4 with SMTP id vw4mr39550259pac.26.1399068572571; Fri, 02 May 2014 15:09:32 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id nw13sm1693724pab.37.2014.05.02.15.09.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 May 2014 15:09:30 -0700 (PDT) From: John Stultz To: LKML Cc: John Stultz , Jan Kara , Peter Zijlstra , Jiri Bohac , Thomas Gleixner , Ingo Molnar , Andrew Morton , Steven Rostedt Subject: [PATCH 3/4] printk: Add printk_once_deferred Date: Fri, 2 May 2014 15:09:17 -0700 Message-Id: <1399068558-2373-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399068558-2373-1-git-send-email-john.stultz@linaro.org> References: <1399068558-2373-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Cc: Peter Zijlstra Cc: Jiri Bohac Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Andrew Morton Cc: Steven Rostedt Signed-off-by: John Stultz --- include/linux/printk.h | 11 +++++++++++ kernel/sched/deadline.c | 7 +------ kernel/sched/rt.c | 8 +------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index 7847301..bd21234 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -266,9 +266,20 @@ extern asmlinkage void dump_stack(void) __cold; 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 --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 657ed68..3ec96bd 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -348,12 +348,7 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se, * 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 --git a/kernel/sched/rt.c b/kernel/sched/rt.c index e7dc728..fd6e9ca 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -890,14 +890,8 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq) * 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,