From patchwork Thu Mar 12 04:16:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 45721 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3EE37214BF for ; Thu, 12 Mar 2015 04:17:09 +0000 (UTC) Received: by lamq1 with SMTP id q1sf9755656lam.3 for ; Wed, 11 Mar 2015 21:17:08 -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=fWsUK8HnAqlMhWMWbi+incsVTf0ESYjkyMhoqQFha70=; b=LtmG62lcnq7y9QA4P+4rdpXn+fv6eqg/kiR/PZZiZYVO7rZqoPMsu+xKrIwjKTQd4n jX6x3zlRHzMgBXBgyJgmmDvxpJmDomyd2s2Soe4Y11iCjBcwLTOMqjppmXOdbzrtFbQx zIsdeD5w4I+m7M14UzclIu2zPVX3tFpKoudDbYrcYCnsw0PuShXkgu29CCprRrYuu+Yt LmBHYbyoU+7XXCminqlIzZmUvmmLMaVfBTVDC3ZZpDXiSUdQ2uesSaWzED498D9MWBuz xNfJwXlK3xHGPTgSmw5GygB/uOEWNqhaaekIDm7CoICW3qCDp5bbWveQO3cWnLbHnm3A b0rQ== X-Gm-Message-State: ALoCoQmxVEshMCXVKKh+nxxt/tTibK15p4J2RfejjFjTkqfskIPffKi3krDh2Ti5asmwlqd9beht X-Received: by 10.112.224.12 with SMTP id qy12mr5858036lbc.10.1426133828234; Wed, 11 Mar 2015 21:17:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.67 with SMTP id o3ls196940laj.67.gmail; Wed, 11 Mar 2015 21:17:08 -0700 (PDT) X-Received: by 10.152.28.233 with SMTP id e9mr37283532lah.3.1426133827993; Wed, 11 Mar 2015 21:17:07 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id bf6si3616428lbc.57.2015.03.11.21.17.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 21:17:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labgm9 with SMTP id gm9so13172103lab.13 for ; Wed, 11 Mar 2015 21:17:07 -0700 (PDT) X-Received: by 10.152.5.194 with SMTP id u2mr37424273lau.88.1426133827904; Wed, 11 Mar 2015 21:17:07 -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.112.35.133 with SMTP id h5csp3173290lbj; Wed, 11 Mar 2015 21:17:07 -0700 (PDT) X-Received: by 10.66.164.98 with SMTP id yp2mr10829948pab.114.1426133814613; Wed, 11 Mar 2015 21:16:54 -0700 (PDT) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com. [209.85.192.175]) by mx.google.com with ESMTPS id de6si6426988pdb.184.2015.03.11.21.16.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 21:16:54 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.175 as permitted sender) client-ip=209.85.192.175; Received: by pdbnh10 with SMTP id nh10so16743370pdb.4 for ; Wed, 11 Mar 2015 21:16:53 -0700 (PDT) X-Received: by 10.66.63.72 with SMTP id e8mr83661617pas.3.1426133813715; Wed, 11 Mar 2015 21:16:53 -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 x1sm3070268pdp.1.2015.03.11.21.16.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Mar 2015 21:16:53 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Dave Jones , Linus Torvalds , Thomas Gleixner , Richard Cochran , Prarit Bhargava , Stephen Boyd , Ingo Molnar , Peter Zijlstra Subject: [PATCH 08/12] clocksource: Improve clocksource watchdog reporting Date: Wed, 11 Mar 2015 21:16:36 -0700 Message-Id: <1426133800-29329-9-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426133800-29329-1-git-send-email-john.stultz@linaro.org> References: <1426133800-29329-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.44 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. Cc: Dave Jones Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: John Stultz --- kernel/time/clocksource.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index a491803..340461e 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -142,13 +142,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 @@ -174,7 +167,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; @@ -213,6 +206,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 in case we print them */ + cslast = cs->cs_last; cs->cs_last = csnow; cs->wd_last = wdnow; @@ -221,7 +216,12 @@ 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; }