Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291155 > unrolled thread

Re: [RFC][PATCH v2] timekeeping: Cap adjustments so they don't exceed the maxadj value

Started byMiroslav Lichvar <mlichvar@redhat.com>
First post2015-12-14 13:50 +0100
Last post2015-12-14 13:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC][PATCH v2] timekeeping: Cap adjustments so they don't  exceed the maxadj value Miroslav Lichvar <mlichvar@redhat.com> - 2015-12-14 13:50 +0100

#1291155 — Re: [RFC][PATCH v2] timekeeping: Cap adjustments so they don't exceed the maxadj value

FromMiroslav Lichvar <mlichvar@redhat.com>
Date2015-12-14 13:50 +0100
SubjectRe: [RFC][PATCH v2] timekeeping: Cap adjustments so they don't exceed the maxadj value
Message-ID<qFAJH-6cU-5@gated-at.bofh.it>
On Thu, Dec 10, 2015 at 11:54:01AM -0800, John Stultz wrote:
> Thus its been occasionally noted that users have seen
> confusing warnings like:
> 
>     Adjusting tsc more than 11% (5941981 vs 7759439)

> @@ -1612,13 +1615,32 @@ static __always_inline void timekeeping_freqadjust(struct timekeeper *tk,
>  	/* preserve the direction of correction */
>  	negative = (tick_error < 0);
>  
> -	/* Sort out the magnitude of the correction */
> +	/* If any adjustment would pass the max, just return */
> +	if (negative && (cur_adj - 1) < (base - max))
> +		return;
> +	if (!negative && (cur_adj + 1) > (base + max))
> +		return;

I ran the test that triggered the warning previously and it was silent
now.

But it looks like timekeeping_adjust() should check the adjustment too
before calling timekeeping_apply_adjustment(). In linux-tktest I was
able to find a configuration (-t 10 -n 150 -p 10000000) that triggered
the warning again. I'm not sure how likely it is to happen in real
world and if it's worth fixing though.

To avoid adding even more code, maybe the check could be moved to
timekeeping_apply_adjustment()? It would try decreasing adj_scale
until the check passes. When it reached -1, the function would return
immediately with no adjustment of the multiplier.

-- 
Miroslav Lichvar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web