public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] KVM: x86: Include host suspended time in steal time.
@ 2024-08-20  4:35 Suleiman Souhlal
  2024-08-20  4:35 ` [PATCH v2 1/3] KVM: Introduce kvm_total_suspend_ns() Suleiman Souhlal
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Suleiman Souhlal @ 2024-08-20  4:35 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Chao Gao, kvm, linux-kernel, ssouhlal,
	Suleiman Souhlal

This series makes it so that the time that the host is suspended is
included in guests' steal time.

When the host resumes from a suspend, the guest thinks any task
that was running during the suspend ran for a long time, even though
the effective run time was much shorter, which can end up having
negative effects with scheduling. This can be particularly noticeable
if the guest task was RT, as it can end up getting throttled for a
long time.

To mitigate this issue, we include the time that the host was
suspended in steal time, which lets the guest can subtract the
duration from the tasks' runtime.

(v1 was at https://lore.kernel.org/kvm/20240710074410.770409-1-suleiman@google.com/)

v1 -> v2:
- Accumulate suspend time at machine-independent kvm layer and track per-VCPU
  instead of per-VM.
- Document changes.

Suleiman Souhlal (3):
  KVM: Introduce kvm_total_suspend_ns().
  KVM: x86: Include host suspended time in steal time.
  KVM: x86: Document host suspend being included in steal time.

 Documentation/virt/kvm/x86/msr.rst |  6 ++++--
 arch/x86/include/asm/kvm_host.h    |  1 +
 arch/x86/kvm/x86.c                 | 11 ++++++++++-
 include/linux/kvm_host.h           |  2 ++
 virt/kvm/kvm_main.c                | 13 +++++++++++++
 5 files changed, 30 insertions(+), 3 deletions(-)

-- 
2.46.0.184.g6999bdac58-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-09-25 13:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20  4:35 [PATCH v2 0/3] KVM: x86: Include host suspended time in steal time Suleiman Souhlal
2024-08-20  4:35 ` [PATCH v2 1/3] KVM: Introduce kvm_total_suspend_ns() Suleiman Souhlal
2024-08-21  5:40   ` Chao Gao
2024-08-21  6:01     ` Suleiman Souhlal
2024-08-20  4:35 ` [PATCH v2 2/3] KVM: x86: Include host suspended time in steal time Suleiman Souhlal
2024-08-21  6:31   ` Chao Gao
2024-08-23  4:17     ` Suleiman Souhlal
2024-08-23  5:25       ` Chao Gao
2024-08-23  5:43         ` Suleiman Souhlal
2024-08-28  9:56   ` Suleiman Souhlal
2024-08-20  4:35 ` [PATCH v2 3/3] KVM: x86: Document host suspend being included " Suleiman Souhlal
2024-09-25 13:54 ` [PATCH v2 0/3] KVM: x86: Include host suspended time " Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox