From patchwork Fri Aug 18 18:51:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 110428 Delivered-To: patches@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1287508qge; Fri, 18 Aug 2017 11:51:16 -0700 (PDT) X-Received: by 10.84.224.141 with SMTP id s13mr10581867plj.212.1503082276462; Fri, 18 Aug 2017 11:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503082276; cv=none; d=google.com; s=arc-20160816; b=dwB3ZdXFAyVCpGeM7kL3CC6CDmZH/jhdkR0DSIp+XfXqEK/iNdDQdx78sMlQVguDXZ 8vDmxPDUYzPNvMjUJM3hsOI6naNzq41ALjRDHac5+R7KzvqN/u+Yar25vzXlH7Bd4EN7 4+i0+qpw+RQTFLkDoQOELMgVbOuEO/DVytxPVG4NpLTMLeFwwTrdxa6NynBQoZtH7VlV +OUs5sq4yKBIqlSRTmz8tko+nDujMyibxFd2U0xLj5lPZepeSGLFCbW4iLUOOoAiYKB9 FrSGtlDK33qaeXJzzgsyUy4ShVj9wT3W1TQsUb4Im1PR9GDasmk2ufDUa8FotqbqFtMb nbTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Atk1s46YfMqtYSkYRGUwmfIxXBXUjXC9ExCBXE98tdA=; b=x1WJFOrigl1h8P3wCTI6RuX7u8+TsVbE+N3+8aVGN5x9JR9r6Lhkc1naG5TDyra648 iXxycu9XQI3CzqxctGn2did/onitY9NSmuBeu+1o6Xf37GyYl32p0UAGTxvOlXBbbDEH d0wjeUwwWAZGzNampReFuxqMS3hqF2KyH2dmjfSQE9mX3KnRygkK1w566ECO1TC5G69t +sqKb4srBy9wUhOTulVVh8x6Oky+dRMV69Pu452UdrJDc9MnNAkAMQZ+JEUWzLvo6sWg QhinviZAjgCjchGEWFrPTh6QyrIh00U0UPunNM5hC78WfpF452j7lD77cTEVXZlMolQx ownA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SUI08Jcr; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22b as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com. [2607:f8b0:400e:c05::22b]) by mx.google.com with ESMTPS id q2si3812588pgn.692.2017.08.18.11.51.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Aug 2017 11:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22b as permitted sender) client-ip=2607:f8b0:400e:c05::22b; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SUI08Jcr; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22b as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x22b.google.com with SMTP id t3so41497898pgt.0 for ; Fri, 18 Aug 2017 11:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Atk1s46YfMqtYSkYRGUwmfIxXBXUjXC9ExCBXE98tdA=; b=SUI08JcrcsKmWA/ObDTVmc971pM4rYvB4ClD+WlDWh5ukoj0OAquHAX8e6fjnh2rNF LvcT59dbiP1VvPca1SoH4VV6ncol5h0lI18qo+qwVALvpTOmB+un4IfUdXl6VIsLkqDg ao6uQd56tjgKuMjTNYU/FbRbxLqZ0btlFpshA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Atk1s46YfMqtYSkYRGUwmfIxXBXUjXC9ExCBXE98tdA=; b=Si0sB+GX1jnhPEMFC4unq90DQ7n+Nqq4+5wd4jsoHwuSms2cLrq+rpuNNZIwS3BZL9 lZtwgleo4v3zRH2ugQQYnTbn1QVGm3JinYEiXCX7rSouGiDRYSVBE0Yg8lxXt77qH/Zh xobkO0zrM3+qnD0qU59TtjsFosiFkZ6YAuNVR0W0ZqiLIjh8PG2+zSFiGoYSc3cCCBTv I/hmUr2x1Fr4923irmXWaPxdruguJDrg/tDvKWTG7Dj4/OXjr+nDLiegyduQdovHRd2c 8tMDYH5E4eyXvVHpkggj7vgLhwUechXxQ2EhSrHYQANM1z4Dmd0gHWx8aiIOGeRqYxfb DAng== X-Gm-Message-State: AHYfb5i18w0iyrd0b0LpAg7WrTYQGp5/dCec6d2x0KGtL+qqqmcuqOyi XW4EnUaCCiL+NlhDuC8= X-Received: by 10.98.150.215 with SMTP id s84mr9860713pfk.109.1503082276201; Fri, 18 Aug 2017 11:51:16 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id l132sm12518790pfc.150.2017.08.18.11.51.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Aug 2017 11:51:15 -0700 (PDT) From: John Stultz To: lkml Cc: Stafford Horne , Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , John Stultz Subject: [PATCH 5/6] timekeeping: Use proper timekeeper for debug code Date: Fri, 18 Aug 2017 11:51:01 -0700 Message-Id: <1503082262-29450-6-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503082262-29450-1-git-send-email-john.stultz@linaro.org> References: <1503082262-29450-1-git-send-email-john.stultz@linaro.org> From: Stafford Horne When CONFIG_DEBUG_TIMEKEEPING is enabled the timekeeping_check_update() function will update status like last_warning and underflow_seen on the timekeeper. If there are issues found this state is used to rate limit the warnings that get printed. This rate limiting doesn't really really work if stored in real_tk as the shadow timekeeper is overwritten onto real_tk at the end of every update_wall_time() call, resetting last_warning and other statuses. Fix rate limiting by using the shadow_timekeeper for timekeeping_check_update(). Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Fixes: commit 57d05a93ada7 ("time: Rework debugging variables so they aren't global") Signed-off-by: Stafford Horne Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cedafa0..8f58669 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -2066,7 +2066,7 @@ void update_wall_time(void) goto out; /* Do some additional sanity checking */ - timekeeping_check_update(real_tk, offset); + timekeeping_check_update(tk, offset); /* * With NO_HZ we may have to accumulate many cycle_intervals