mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "pang.xunlei" <pang.xunlei@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"pang.xunlei" <pang.xunlei@linaro.org>
Subject: [PATCH 2/2] time: Complete NTP adjustment threshold judging conditions
Date: Thu,  9 Oct 2014 15:04:31 +0800	[thread overview]
Message-ID: <1412838271-11175-2-git-send-email-pang.xunlei@linaro.org> (raw)
In-Reply-To: <1412838271-11175-1-git-send-email-pang.xunlei@linaro.org>

The clocksource mult-adjustment threshold is [mult-maxadj, mult+maxadj],
timekeeping_adjust() only deals with the upper threshold, but misses the
lower threshold.

This patch adds the lower threshold judging condition.

Signed-off-by: pang.xunlei <pang.xunlei@linaro.org>
---
 kernel/time/timekeeping.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index cad61b3..469cdbf 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1403,7 +1403,7 @@ static void timekeeping_adjust(struct timekeeper *tk, s64 offset)
 	}
 
 	if (unlikely(tk->tkr.clock->maxadj &&
-		(tk->tkr.mult > tk->tkr.clock->mult + tk->tkr.clock->maxadj))) {
+		(abs(tk->tkr.mult - tk->tkr.clock->mult) > tk->tkr.clock->maxadj))) {
 		printk_once(KERN_WARNING
 			"Adjusting %s more than 11%% (%ld vs %ld)\n",
 			tk->tkr.clock->name, (long)tk->tkr.mult,
-- 
1.7.10.4


  reply	other threads:[~2014-10-09  7:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09  7:04 [PATCH 1/2] time: Fix NTP adjustment mult overflow pang.xunlei
2014-10-09  7:04 ` pang.xunlei [this message]
2014-10-24  4:34   ` [PATCH 2/2] time: Complete NTP adjustment threshold judging conditions John Stultz
2014-10-21 10:19 ` [PATCH 1/2] time: Fix NTP adjustment mult overflow Thomas Gleixner
2014-10-21 16:11   ` John Stultz
2014-10-21 19:35     ` Thomas Gleixner
     [not found]       ` <CADcy93UMxdD0AwgwAjLYNC7TtdttC5rb3D7N8FSskrbkCMh_HA@mail.gmail.com>
2014-10-24  4:22         ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412838271-11175-2-git-send-email-pang.xunlei@linaro.org \
    --to=pang.xunlei@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®