Re: [PATCH v2 clocksource 6/7] clocksource: Verify HPET and PMTMR when TSC unverified

From: Paul E. McKenney
Date: Fri Feb 03 2023 - 20:27:25 EST


On Thu, Feb 02, 2023 at 08:57:39AM +0100, Thomas Gleixner wrote:
> On Wed, Feb 01 2023 at 22:40, Waiman Long wrote:
> > On 2/1/23 14:55, Paul E. McKenney wrote:
> >>>>> Therefore, when watchdog verification of TSC is disabled, enable it for
> >>>>> HPET and PMTMR (AKA ACPI PM timer). This provides the needed in-kernel
> >>>>> time-skew diagnostic without degrading the system's performance.
> >>>> I'm more than unhappy about this. We finally have a point where the TSC
> >>>> watchdog overhead can go away without adding TSC=reliable to the kernel
> >>>> commandline.
> >>>>
> >>>> Now you add an unconditionally enforce the watchdog again in a way which
> >>>> even cannot be disabled on the kernel command line.
> >>>>
> >>>> Patently bad idea, no cookies for you!
> >>> I have a similar concern about this patch as well. That is why I was
> >>> suggesting to have this enabled for a limited time after boot for sanity
> >>> checking purpose only.
> >> Fair enough!
> >>
> >> If the watchdog checking of HPET and/or PMTMR against TSC only happens
> >> only when the sysadm asks for it, would you still want to have the ability
> >> to enable such watchdog checking at boot time, and then to disable it
> >> once the system had been running for some limited time?
> >
> > Yes, being optional is another way to avoid the overhead for the
> > majority of users. The paranoids can turn it on if they want to.
>
> Yes, opt-in is good enough.

I have added this commit to my clocksource branch:

2ff7dacc88b0 clocksource: Enable TSC watchdog checking of HPET and PMTMR only when requested

It is passing my internal tests, and if it does fine for a couple of
days in -next, I will send an updated pull request.

Thanx, Paul

------------------------------------------------------------------------

The full clocksource branch:

beaa1ffe551c3 clocksource: Print clocksource name when clocksource is tested unstable
c37e85c135cea clocksource: Loosen clocksource watchdog constraints
f092eb34b3304 clocksource: Improve read-back-delay message
dd029269947a3 clocksource: Improve "skew is too large" messages
b7082cdfc464b clocksource: Suspend the watchdog temporarily when high read latency detected
a7ec817d55421 x86/tsc: Add option to force frequency recalibration with HW timer
efc8b329c7fdc clocksource: Verify HPET and PMTMR when TSC unverified
2ff7dacc88b0c clocksource: Enable TSC watchdog checking of HPET and PMTMR only when requested