From patchwork Tue Sep 18 00:36:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11479 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 29839392CCF for ; Tue, 18 Sep 2012 00:36:32 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id C0BC2A18348 for ; Tue, 18 Sep 2012 00:36:31 +0000 (UTC) Received: by ieak11 with SMTP id k11so10059541iea.11 for ; Mon, 17 Sep 2012 17:36:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=/uZ7Ptw5h8xN4BvRIpejfOebS/M59FqGRb0isN3J29E=; b=PHzvYpBoVxtt5Jj91HneaeaaL+wSilpxvMy9AsfsBsTkN0GxhoC1fZ+pqZut9N7IjV SVVmaU18BH0iAmp8uOBkkwxwXTPfnTy4UPr2FsgrVnsbY0yzO+fwrAs/X/R819yHFhtA vDjkHQpkWAbSG8ImYaHZWJocwZBmKnS3rbJKpa4mMiQyLej86dQQepmIgRZjSZ4APCGf l+cdCrt7t+0akBPpTjPiUiJYcbm6A+2YziBJACnAnNC2ePk8OERQZQr8dKlqx4k2zAN6 8iGA/PnhRn3yFxCrsUtV+41MAmWXJ24Nl/2YfqNAtMKvZUd7vgCu/5qKWYt7MLF/0Ky4 I7yA== Received: by 10.50.184.129 with SMTP id eu1mr2729139igc.0.1347928590869; Mon, 17 Sep 2012 17:36:30 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp345627igc; Mon, 17 Sep 2012 17:36:30 -0700 (PDT) Received: by 10.60.11.1 with SMTP id m1mr13287904oeb.47.1347928590099; Mon, 17 Sep 2012 17:36:30 -0700 (PDT) Received: from e36.co.us.ibm.com (e36.co.us.ibm.com. [32.97.110.154]) by mx.google.com with ESMTPS id zm6si11826189obb.55.2012.09.17.17.36.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 17:36:30 -0700 (PDT) Received-SPF: neutral (google.com: 32.97.110.154 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=32.97.110.154; Authentication-Results: mx.google.com; spf=neutral (google.com: 32.97.110.154 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Sep 2012 18:36:29 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 17 Sep 2012 18:36:26 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A259D1FF003C; Mon, 17 Sep 2012 18:36:22 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8I0aPFV242936; Mon, 17 Sep 2012 18:36:25 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q8I0bukS008560; Mon, 17 Sep 2012 18:37:56 -0600 Received: from kernel-pok.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q8I0bspE008500; Mon, 17 Sep 2012 18:37:56 -0600 From: John Stultz To: stable@vger.kernel.org Cc: John Stultz , Prarit Bhargava , Ingo Molnar , Thomas Gleixner Subject: [PATCH 2/3] 2.6.35.y: time: Avoid making adjustments if we haven't accumulated anything Date: Mon, 17 Sep 2012 20:36:19 -0400 Message-Id: <1347928580-22833-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347928580-22833-1-git-send-email-john.stultz@linaro.org> References: <1347928580-22833-1-git-send-email-john.stultz@linaro.org> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12091800-7606-0000-0000-000003C1F7CC X-Gm-Message-State: ALoCoQlnWtMw55bQkFGZXD/1126bbl9Rxd3kxCLeJT8Cr67DqyvFxBOtWmGkPAN/uvx/XFRiH2bS This is a -stable backport of bf2ac312195155511a0f79325515cbb61929898a If update_wall_time() is called and the current offset isn't large enough to accumulate, avoid re-calling timekeeping_adjust which may change the clock freq and can cause 1ns inconsistencies with CLOCK_REALTIME_COARSE/CLOCK_MONOTONIC_COARSE. Signed-off-by: John Stultz Cc: Prarit Bhargava Cc: Ingo Molnar Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1345595449-34965-5-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 4f760d4..ae27d69 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -842,6 +842,10 @@ void update_wall_time(void) #else offset = timekeeper.cycle_interval; #endif + /* Check if there's really nothing to do */ + if (offset < timekeeper.cycle_interval) + return; + timekeeper.xtime_nsec = (s64)xtime.tv_nsec << timekeeper.shift; /*