From patchwork Wed Apr 23 03:36:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 28844 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8B5C1203AC for ; Wed, 23 Apr 2014 03:37:12 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b6sf1621568yha.0 for ; Tue, 22 Apr 2014 20:37:12 -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=UBB8AA98PS3uv/eB3lmyoDlvWEbotM7lpWcote+YPHM=; b=OhzbkSwTW6IDpU7gf04O8RxQKn2vPkToA7WaAqX+JBnwc4TcvgGXkrlalAkr83DgfO pl3OsEpg6mFMYxanDIxG8PwFwq2Qmez54Vqv0sSffganva5BYFlHYOcogzTmIqC6Ym0w iEySQa0SCWvxCMGzEzV3y7CYmOWapqhaSja89CJ5HqlgO78Rn1a6i/vMYfIy11zBUjHC jaHFNpQ/st/WrdUb4JljS0D6dgpyGvReG+9dsCHloM0zYUgJ3xw41d3fr0cPBN/Nodh6 P0VQBGifY5k3GZOUuZuJirLvrPyrRG31ZsW0zHAJF2j/p/R0Vc60oy0ijw9UfDH9Najc jxpA== X-Gm-Message-State: ALoCoQkC3Z/8xhUqdB5j6amEIp3G2T4vpnntu6YYpN0F7UsSpCQsG3SXpICIskDFqzAgUQc6Bt64 X-Received: by 10.236.32.236 with SMTP id o72mr20512157yha.42.1398224232317; Tue, 22 Apr 2014 20:37:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.106 with SMTP id o97ls374732qgd.50.gmail; Tue, 22 Apr 2014 20:37:12 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr431002vck.29.1398224232231; Tue, 22 Apr 2014 20:37:12 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id o2si7221839vew.61.2014.04.22.20.37.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 20:37:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id db12so443762veb.24 for ; Tue, 22 Apr 2014 20:37:12 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr40611699vcb.0.1398224232144; Tue, 22 Apr 2014 20:37:12 -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 ib8csp72970vcb; Tue, 22 Apr 2014 20:37:11 -0700 (PDT) X-Received: by 10.68.89.225 with SMTP id br1mr20440477pbb.114.1398224231419; Tue, 22 Apr 2014 20:37:11 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id iw1si19242262pbb.110.2014.04.22.20.37.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 20:37:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id rd3so314212pab.9 for ; Tue, 22 Apr 2014 20:37:11 -0700 (PDT) X-Received: by 10.68.250.3 with SMTP id yy3mr50285509pbc.56.1398224231013; Tue, 22 Apr 2014 20:37:11 -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 yx3sm88266665pbb.6.2014.04.22.20.37.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 20:37:10 -0700 (PDT) From: John Stultz To: LKML Cc: John Stultz , Jan Kara , Peter Zijlstra , Jiri Bohac , Thomas Gleixner , Ingo Molnar , Andrew Morton Subject: [RFC][PATCH 2/3] printk: Add printk_once_deferred Date: Tue, 22 Apr 2014 20:36:57 -0700 Message-Id: <1398224218-4429-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398224218-4429-1-git-send-email-john.stultz@linaro.org> References: <1398224218-4429-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: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 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 c19b3cc..722e9a3 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -851,14 +851,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,