Skip to content

Automatically grab wallclock time updates from hypervisor

Glauber Costa kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v12 patches 8 repliesSuperseded

Changes in v2 from the cover letter

* disabled by default
* adjust clock in a loop, to prevent agaist host scheduling.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2keep guest wallclock in sync with host clockarch/x86/kernel/kvmclock.c+61 -95 replies
2/2add sysctl for kvm wallclock syncarch/x86/include/asm/kvm_para.h arch/x86/kernel/kvmclock.c kernel/sysctl.c+35 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] Automatically grab wallclock time updates from hypervisor

i folks,

In this proposed patch, I am introducing a worker fired by kvmclock that updates guest wallclock periodically to reflect changes in the host's wallclock. With this patch, a large pool of VMs will no longer have to run NTP in all of its guests.

The worker does that at a configurable interval, with a minimum granularity of 1 second. So, although not exactly cheap, the msr write needed to get an updated wallclock value won't pose a heavy burden on the system.

It is also possible to disable it completely if this behaviour is undesired for a specific scenario.

Changes from v1:
* disabled by default
* adjust clock in a loop, to prevent agaist host scheduling.

diffstat follows:

 arch/x86/include/asm/kvm_para.h |    6 +++
 arch/x86/kernel/kvmclock.c      |   85 ++++++++++++++++++++++++++++++++++----
 kernel/sysctl.c                 |   13 ++++++
 3 files changed, 95 insertions(+), 9 deletions(-)