From patchwork Fri Jan 23 00:09:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 43552 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0008E218DB for ; Fri, 23 Jan 2015 00:10:03 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e49sf3199453eek.3 for ; Thu, 22 Jan 2015 16:10:03 -0800 (PST) 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=arlh3VEdAmdK/tI5fOqY1QjFR/pdjVyKiYi+ILIulTM=; b=S/W15whJEnC/BIkDESLgWU9MNmDBeV5wR9Psm+Ed3BTzUBEbJNBirEBNp8j6KRlvJ0 qoZg7QE68lYGrsT/RBDl3Jza/G4r7L823QoyssnSdPiZC28AOEmNYGRks4AveaI6MXDN 2cYbsQ0R7WYGWqOjRiBmJuKrN2p+S6fBQZQsPzh70YZGFEsXXOdsIjc5xxe2h2wE8oJ9 Q79FZe+VKqEn36Hmn4y59tjne+V/JPSz8oNaGyExYHGW2jVl5QVP6KI4FyYYL+20xYKU qnHuo7zvX8dK/Lj6olXM5O0QUq1AgbA1+0K0MYCi0obXTBx7qg/zvFarqTvykJb3oSRH 935Q== X-Gm-Message-State: ALoCoQmceqXxiW9kgq+Hj6AktRoM6+pi2ORH/yLggZZOda9oWBy/khyOzohH+Pe1KhSCfoNm63M0 X-Received: by 10.152.2.40 with SMTP id 8mr2775lar.7.1421971803227; Thu, 22 Jan 2015 16:10:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.1 with SMTP id ku1ls230542lac.80.gmail; Thu, 22 Jan 2015 16:10:03 -0800 (PST) X-Received: by 10.152.7.180 with SMTP id k20mr4650466laa.4.1421971803090; Thu, 22 Jan 2015 16:10:03 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id jq5si22064651lbc.39.2015.01.22.16.10.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 16:10:03 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so4637073lab.6 for ; Thu, 22 Jan 2015 16:10:03 -0800 (PST) X-Received: by 10.112.84.225 with SMTP id c1mr4529890lbz.22.1421971802954; Thu, 22 Jan 2015 16:10:02 -0800 (PST) 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.112.9.200 with SMTP id c8csp63975lbb; Thu, 22 Jan 2015 16:10:01 -0800 (PST) X-Received: by 10.68.201.166 with SMTP id kb6mr6759222pbc.28.1421971784591; Thu, 22 Jan 2015 16:09:44 -0800 (PST) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com. [209.85.220.43]) by mx.google.com with ESMTPS id fe8si14134122pad.225.2015.01.22.16.09.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 16:09:44 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.43 as permitted sender) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id eu11so5012213pac.2 for ; Thu, 22 Jan 2015 16:09:43 -0800 (PST) X-Received: by 10.70.90.170 with SMTP id bx10mr6736731pdb.104.1421971783657; Thu, 22 Jan 2015 16:09:43 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id am14sm10405657pac.35.2015.01.22.16.09.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jan 2015 16:09:43 -0800 (PST) From: John Stultz To: Linux Kernel Mailing List Cc: John Stultz Subject: [PATCH 09/12] clocksource: Improve clocksource watchdog reporting Date: Thu, 22 Jan 2015 16:09:24 -0800 Message-Id: <1421971767-17707-10-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421971767-17707-1-git-send-email-john.stultz@linaro.org> References: <1421971767-17707-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) 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: , The clocksource watchdog reporting has been less helpful then desired, as it just printed the delta between the two clocksources. This prevents any useful analysis of why the skew occurred. Thus this patch tries to improve the output when we mark a clocksource as unstable, printing out the cycle last and now values for both the current clocksource and the watchdog clocksource. This will allow us to see if the result was due to a false positive caused by a problematic watchdog. Signed-off-by: John Stultz --- kernel/time/clocksource.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index c2f8639..4aca66d 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -218,13 +218,6 @@ static void __clocksource_unstable(struct clocksource *cs) schedule_work(&watchdog_work); } -static void clocksource_unstable(struct clocksource *cs, int64_t delta) -{ - printk(KERN_WARNING "Clocksource %s unstable (delta = %Ld ns)\n", - cs->name, delta); - __clocksource_unstable(cs); -} - /** * clocksource_mark_unstable - mark clocksource unstable via watchdog * @cs: clocksource to be marked unstable @@ -250,7 +243,7 @@ void clocksource_mark_unstable(struct clocksource *cs) static void clocksource_watchdog(unsigned long data) { struct clocksource *cs; - cycle_t csnow, wdnow, delta; + cycle_t csnow, wdnow, cslast, wdlast, delta; int64_t wd_nsec, cs_nsec; int next_cpu, reset_pending; @@ -289,6 +282,8 @@ static void clocksource_watchdog(unsigned long data) delta = clocksource_delta(csnow, cs->cs_last, cs->mask); cs_nsec = clocksource_cyc2ns(delta, cs->mult, cs->shift); + wdlast = cs->wd_last; /* save these incase we print them */ + cslast = cs->cs_last; cs->cs_last = csnow; cs->wd_last = wdnow; @@ -297,7 +292,15 @@ static void clocksource_watchdog(unsigned long data) /* Check the deviation from the watchdog clocksource. */ if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) { - clocksource_unstable(cs, cs_nsec - wd_nsec); + pr_warn("Watchdog: clocksource %s unstable\n", + cs->name); + pr_warn(" " + "%s wd_now: %llx wd_last: %llx mask: %llx\n", + watchdog->name, wdnow, wdlast, watchdog->mask); + pr_warn(" " + "%s cs_now: %llx cs_last: %llx mask: %llx\n", + cs->name, csnow, cslast, cs->mask); + __clocksource_unstable(cs); continue; }