Re: [PATCH v14 clocksource 4/6] clocksource: Reduce clocksource-skew threshold for TSC
From: Feng Tang
Date: Wed May 12 2021 - 09:18:22 EST
Hi Paul,
On Tue, May 11, 2021 at 08:51:56PM -0700, Paul E. McKenney wrote:
> On Wed, May 12, 2021 at 10:18:49AM +0800, Feng Tang wrote:
> > Hi Paul,
> >
> > On Tue, May 11, 2021 at 04:34:53PM -0700, Paul E. McKenney wrote:
[SNIP]
> > > * Ensure clocksources that have large 'mult' values don't overflow
> > > * when adjusted.
> > > diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
> > > index a492e4da69ba..b3f608c2b936 100644
> > > --- a/kernel/time/jiffies.c
> > > +++ b/kernel/time/jiffies.c
> > > @@ -49,13 +49,14 @@ static u64 jiffies_read(struct clocksource *cs)
> > > * for "tick-less" systems.
> > > */
> > > static struct clocksource clocksource_jiffies = {
> > > - .name = "jiffies",
> > > - .rating = 1, /* lowest valid rating*/
> > > - .read = jiffies_read,
> > > - .mask = CLOCKSOURCE_MASK(32),
> > > - .mult = TICK_NSEC << JIFFIES_SHIFT, /* details above */
> > > - .shift = JIFFIES_SHIFT,
> > > - .max_cycles = 10,
> > > + .name = "jiffies",
> > > + .rating = 1, /* lowest valid rating*/
> > > + .uncertainty_margin = TICK_NSEC,
> >
> > 'jiffies' is known to be very bad as a watchdog ("worse bandaid" in
> > Thomas' words :)), and TICK_NSEC just turns to 1ms for HZ=1000 case.
> > Maybe we should give it a bigger margin, like the 32ms margin for
> > 'tsc-early'?
> >
> > Other than this, it looks good to me, thanks!
>
> As in the fixup diff below?
Yep, thanks,
>
> Would you be willing to provide an ack or tested-by for the rest
> of the series? (I have your ack on 1/6.)
I haven't figured out a way to check 5/6 patch yet, but feel free
to add my ack for the first 4 patches (1/6 ~ 4/6)
Acked-by: Feng Tang <feng.tang@xxxxxxxxx>
Thanks,
Feng
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
> index b3f608c2b936..01935aafdb46 100644
> --- a/kernel/time/jiffies.c
> +++ b/kernel/time/jiffies.c
> @@ -51,7 +51,7 @@ static u64 jiffies_read(struct clocksource *cs)
> static struct clocksource clocksource_jiffies = {
> .name = "jiffies",
> .rating = 1, /* lowest valid rating*/
> - .uncertainty_margin = TICK_NSEC,
> + .uncertainty_margin = 32 * NSEC_PER_MSEC,
> .read = jiffies_read,
> .mask = CLOCKSOURCE_MASK(32),
> .mult = TICK_NSEC << JIFFIES_SHIFT, /* details above */