From patchwork Sat Mar 7 02:50:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 45511 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B3BD9214A0 for ; Sat, 7 Mar 2015 02:50:42 +0000 (UTC) Received: by labgq15 with SMTP id gq15sf5590609lab.1 for ; Fri, 06 Mar 2015 18:50:41 -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=ab7ANEmSVpje0SSpqO7gRs59kqupDpUKLDEUpV3DNCo=; b=kib3USRfn8C+0EmYAaYD5vSsRLoiDwZuPsEA04i3lcNQQBiQjyaQl4yMdWDiI3m0NU gDYYV0EHxL/h0t1UekAB2VAKBgmljkltwsLDa2h4CVtnic03CI/ZjALDqOaSyTOXccIt t/E6kusLes/kaUrPWkigiQEI/debYo/2gfIuil+RoZTCvKdkg39v1/1XCTszFf5fdbaR hZMfEISiDlIMlWYp2rMRbWokUtAnLApdBTi88FDaUcOFzwwnggpexKU3JDd9lokGIlqr NBfw9ODcHcGhM4JCL475t2m+H02L0FWoYdYutr8g8TCRQ2egPsB7MpNMZEDHB+qqK/D1 snVQ== X-Gm-Message-State: ALoCoQnsxowZXpXlKv8LWFTHiyOO6KDYfq40IJPkoi67HjGcqnhXFcaxzjvRlfgWBgIqwb+z0cJE X-Received: by 10.112.189.227 with SMTP id gl3mr2785589lbc.2.1425696641692; Fri, 06 Mar 2015 18:50:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.98 with SMTP id l2ls118591lam.28.gmail; Fri, 06 Mar 2015 18:50:41 -0800 (PST) X-Received: by 10.112.8.68 with SMTP id p4mr15274147lba.37.1425696641384; Fri, 06 Mar 2015 18:50:41 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ka5si8509221lbc.119.2015.03.06.18.50.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 18:50:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lamq1 with SMTP id q1so38146026lam.9 for ; Fri, 06 Mar 2015 18:50:41 -0800 (PST) X-Received: by 10.112.8.101 with SMTP id q5mr9718256lba.19.1425696641279; Fri, 06 Mar 2015 18:50:41 -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.35.133 with SMTP id h5csp256488lbj; Fri, 6 Mar 2015 18:50:40 -0800 (PST) X-Received: by 10.70.131.41 with SMTP id oj9mr31338260pdb.12.1425696633489; Fri, 06 Mar 2015 18:50:33 -0800 (PST) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com. [209.85.192.171]) by mx.google.com with ESMTPS id em4si17535907pac.131.2015.03.06.18.50.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 18:50:33 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.171 as permitted sender) client-ip=209.85.192.171; Received: by pdbnh10 with SMTP id nh10so56033856pdb.3 for ; Fri, 06 Mar 2015 18:50:32 -0800 (PST) X-Received: by 10.66.63.7 with SMTP id c7mr31189585pas.13.1425696632604; Fri, 06 Mar 2015 18:50:32 -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 a2sm8381456pbu.27.2015.03.06.18.50.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Mar 2015 18:50:31 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz Subject: [PATCH 09/12] clocksource: Improve clocksource watchdog reporting Date: Fri, 6 Mar 2015 18:50:00 -0800 Message-Id: <1425696603-16878-10-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425696603-16878-1-git-send-email-john.stultz@linaro.org> References: <1425696603-16878-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.53 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 e6c752b..51c7b3a 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 incase we print them */ + cslast = cs->cs_last; cs->cs_last = csnow; cs->wd_last = wdnow; @@ -221,7 +216,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; }