From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755767Ab1KDPW0 (ORCPT ); Fri, 4 Nov 2011 11:22:26 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:41811 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755612Ab1KDPWZ (ORCPT ); Fri, 4 Nov 2011 11:22:25 -0400 Date: Fri, 4 Nov 2011 16:20:38 +0100 From: Ingo Molnar To: John Stultz Cc: LKML , Yong Zhang , David Daney , Thomas Gleixner Subject: Re: [PATCH] clocksource: Avoid selecting mult values that might overflow when adjusted Message-ID: <20111104152035.GA1847@elte.hu> References: <1320264087-3413-1-git-send-email-john.stultz@linaro.org> <20111103211000.GA17895@elte.hu> <1320412312.3514.1.camel@js-netbook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1320412312.3514.1.camel@js-netbook> User-Agent: Mutt/1.5.21 (2010-09-15) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=AWL,BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 AWL AWL: From: address is in the auto white-list Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * John Stultz wrote: > On Thu, 2011-11-03 at 22:10 +0100, Ingo Molnar wrote: > > * John Stultz wrote: > > > > > For some frequqencies, the clocks_calc_mult_shift() function will > > > unfortunately select mult values very close to 0xffffffff. This > > > has the potential to overflow when NTP adjusts the clock, adding > > > to the mult value. > > > > > > This patch adds a clocksource.maxadj value, which provides > > > an approximation of an 11% adjustment(NTP limits adjustments to > > > 500ppm and the tick adjustment is limited to 10%), which could > > > be made to the clocksource.mult value. This is then used to both > > > check that the current mult value won't overflow/underflow, as > > > well as warning us if the timekeeping_adjust() code pushes over > > > that 11% boundary. > > > > > > CC: Yong Zhang > > > CC: David Daney > > > CC: Thomas Gleixner > > > Reported-by: Chen Jie > > > Reported-by: zhangfx > > > Signed-off-by: John Stultz > > > --- > > > include/linux/clocksource.h | 3 +- > > > kernel/time/clocksource.c | 53 ++++++++++++++++++++++++++++++++++-------- > > > kernel/time/timekeeping.c | 3 ++ > > > 3 files changed, 48 insertions(+), 11 deletions(-) > > > > This patch (included in tip:timers/urgent) causes the following boot > > warning x86: > > > > [ 0.000000] Fast TSC calibration using PIT > > [ 0.000000] ------------[ cut here ]------------ > > [ 0.000000] WARNING: at kernel/time/timekeeping.c:855 do_timer+0x47f/0x4c0() > > [ 0.000000] Hardware name: System Product Name > > [ 0.000000] Adjusting more then 11% > > [ 0.000000] Modules linked in: > > [ 0.000000] Pid: 0, comm: swapper Not tainted 3.1.0-tip+ #161792 > > [ 0.000000] Call Trace: > > [ 0.000000] [] warn_slowpath_common+0x7a/0xb0 > > [ 0.000000] [] warn_slowpath_fmt+0x41/0x50 > > [ 0.000000] [] do_timer+0x47f/0x4c0 > > [ 0.000000] [] tick_periodic+0x63/0x80 > > [ 0.000000] [] tick_handle_periodic+0x21/0x70 > > [ 0.000000] [] timer_interrupt+0x18/0x20 > > [ 0.000000] [] handle_irq_event_percpu+0x5e/0x220 > > [ 0.000000] [] handle_irq_event+0x3b/0x60 > > [ 0.000000] [] handle_level_irq+0x6c/0xd0 > > [ 0.000000] [] handle_irq+0x44/0xa0 > > > > Full bootlog and config attached. > > > > i've excluded it from tip:master for now. > > Sounds good. Thanks for the heads up. Do you have a dmesg for this > system as well, so I can narrow down what I should try to reproduce > this on? The full bootlog that i attached to my report is a dmesg - do you need any other info beyond that? Thanks, Ingo