Re: [PATCH] watchdog: Reliable handling of timestamps

From: Petr Mladek
Date: Wed May 19 2021 - 08:01:39 EST


On Wed 2021-05-19 13:43:34, Petr Mladek wrote:
> The commit 9bf3bc949f8aeefeacea4b ("watchdog: cleanup handling of false
> positives") tried to handle a virtual host stopped by the host a more
> straightforward and cleaner way.
>
> But it introduced a risk of false softlockup reports. The virtual host
> might be stopped at any time, for example between
> kvm_check_and_clear_guest_paused() and is_softlockup().
> As a result, is_softlockup() might read the updated jiffies
> are detects softlockup.
>
> Fix all the problems by making the code even more explicit.

This is my preferred solution. It makes it clear when the various
values are read and various situations handled.

In the original code, kvm_check_and_clear_guest_paused() was handled
partially in the given and partially in the next watchdog_timer_fn()
invocation.

It would be great to push this patch or at least Sergey's revert
for 5.13.

Best Regards,
Petr