Re: [PATCH RFC 2/2] sched/core: Defer preempted remote vCPU task clock updates
From: Sean Christopherson
Date: Mon Sep 21 2026 - 12:44:13 EST
On Sun, Aug 23, 2026, Dongli Zhang wrote:
> A remote update of a runqueue can advance rq->clock while the owner
> vCPU is still preempted by the host. KVM publishes the matching stealtime
> when the vCPU is about to re-enter the guest, so the remote CPU can
> otherwise charge the stolen interval to rq->clock_task.
>
> Defer clock_task updates made by a remote CPU while the owner vCPU is
> reported preempted. Fold the deferred delta back into the next update
> that can proceed so IRQ and steal accounting process it together.
>
> This requires the hypervisor to publish up-to-date stealtime before
> clearing the preempted data.
What happens if the hypervisor doesn't do that? Because it's infeasible to
guarantee this will never run on an older version of KVM.