From: Thomas Gleixner <tglx@linutronix.de>
To: "pang.xunlei" <pang.xunlei@linaro.org>
Cc: linux-kernel@vger.kernel.org, John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH 1/2] time: Fix NTP adjustment mult overflow.
Date: Tue, 21 Oct 2014 12:19:55 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1410211210000.5308@nanos> (raw)
In-Reply-To: <1412838271-11175-1-git-send-email-pang.xunlei@linaro.org>
On Thu, 9 Oct 2014, pang.xunlei wrote:
First of all: Please use proper line breaks in the changelog.
> The mult memember of struct clocksource should always be a large u32
> number when calculated through __clocksource_updatefreq_scale(). The
> value of (cs->mult+cs->maxadj) may have a chance to reach very near
> 0xFFFFFFFF.
And what's the actual problem with reaching a value near 0xFFFFFFFF?
> For instance, 555MHz oscillator: cs->mult is 0xE6A17102,
> cs->maxadj is 0x195E8EFD, cs->mult+cs->maxadj is 0xFFFFFFFF. Such
> oscillators would probably exist on some processors like MIPS which
> use CP0 compare/count CPU clock as the clock source.
Again, what's the problem?
> Clocksource might encounter large frequency adjustment due to the
> hardware unstability, environment temperature, software deviation,
> NTP algorithm accuracy, etc. When NTP slewes the clock, kernel goes
> through update_wall_time()->...->timekeeping_apply_adjustment():
> tk->tkr.mult += mult_adj; Unfortunately, tk->tkr.mult may overflow
> after this operation, though such cases are next to impossible to
> happen in practice.
So you adding this just for correctness reasons, not because you
observed the problem in practice?
Thanks,
tglx
next prev parent reply other threads:[~2014-10-21 10:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-09 7:04 pang.xunlei
2014-10-09 7:04 ` [PATCH 2/2] time: Complete NTP adjustment threshold judging conditions pang.xunlei
2014-10-24 4:34 ` John Stultz
2014-10-21 10:19 ` Thomas Gleixner [this message]
2014-10-21 16:11 ` [PATCH 1/2] time: Fix NTP adjustment mult overflow 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=alpine.DEB.2.11.1410211210000.5308@nanos \
--to=tglx@linutronix.de \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pang.xunlei@linaro.org \
/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®