From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757021AbbCGJWZ (ORCPT ); Sat, 7 Mar 2015 04:22:25 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:39111 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754045AbbCGJWW (ORCPT ); Sat, 7 Mar 2015 04:22:22 -0500 Date: Sat, 7 Mar 2015 10:22:15 +0100 From: Ingo Molnar To: John Stultz Cc: lkml , Dave Jones , Linus Torvalds , Thomas Gleixner , Richard Cochran , Prarit Bhargava , Stephen Boyd , Peter Zijlstra Subject: Re: [PATCH 02/12] clocksource: Simplify logic around clocksource wrapping saftey margins Message-ID: <20150307092215.GC30888@gmail.com> References: <1425696603-16878-1-git-send-email-john.stultz@linaro.org> <1425696603-16878-3-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1425696603-16878-3-git-send-email-john.stultz@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * John Stultz wrote: > The clocksource logic has a number of places where we try to > include a safety margin. Most of these are 12% safety margins, > but they are inconsistently applied and sometimes are applied > on top of each other. > > Additionally, in the previous patch, we corrected an issue > where we unintentionally in effect created a 50% saftey margin, > which these 12.5% margins where then added to. > > So to siplify the logic here, this patch removes the various Typo. > 12.5% margins, and consolidates adding the margin in one place: > clocks_calc_max_nsecs(). > > Addtionally, Linus prefers a 50% safety margin, as it allows > bad clock values to be more easily caught. This should really > have no net effect, due to the corrected issue earlier which > caused greater then 50% margins to be used w/o issue. > > Cc: Dave Jones > Cc: Linus Torvalds > Cc: Thomas Gleixner > Cc: Richard Cochran > Cc: Prarit Bhargava > Cc: Stephen Boyd > Cc: Ingo Molnar > Cc: Peter Zijlstra > Acked-by: Stephen Boyd (for sched_clock.c bit) > Signed-off-by: John Stultz > --- > kernel/time/clocksource.c | 26 ++++++++++++-------------- > kernel/time/sched_clock.c | 4 ++-- > 2 files changed, 14 insertions(+), 16 deletions(-) > > diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c > index 11323f4..e5d00e6 100644 > --- a/kernel/time/clocksource.c > +++ b/kernel/time/clocksource.c > @@ -469,6 +469,9 @@ static u32 clocksource_max_adjustment(struct clocksource *cs) > * @shift: cycle to nanosecond divisor (power of two) > * @maxadj: maximum adjustment value to mult (~11%) > * @mask: bitmask for two's complement subtraction of non 64 bit counters > + * > + * NOTE: This function includes a saftey margin of 50%, so that bad clock values Typo. There's also the same typo in the title of the patch. Thanks, Ingo