[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1410211210000.5308@nanos>
Date: Tue, 21 Oct 2014 12:19:55 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: "pang.xunlei" <pang.xunlei@...aro.org>
cc: linux-kernel@...r.kernel.org, John Stultz <john.stultz@...aro.org>
Subject: Re: [PATCH 1/2] time: Fix NTP adjustment mult overflow.
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists