On debian guest:
# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
refined-jiffies
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
refined-jiffies jiffies

In */etc/default/grub *I appended clocksource=tsc tsc=reliable in the
variable GRUB_CMDLINE_LINUX_DEFAULT
Before:
   GRUB_CMDLINE_LINUX_DEFAULT="quiet"
After:
   GRUB_CMDLINE_LINUX_DEFAULT="quiet clocksource=tsc tsc=reliable"

Update GRUB:
#sudo update-grub

After rebooting:
# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc

Now sleep on guest debian works as expected.

Thanks a lot!!!



Il giorno sab 21 ott 2023 alle ore 16:54 Brian Conway <
bcon...@rcesoftware.com> ha scritto:

> On Sat, Oct 21, 2023, at 2:36 AM, Luca Di Gregorio wrote:
> > Host:
> > # uname -a
> > OpenBSD xxx.my.domain 7.4 GENERIC.MP#1397 amd64
> > # dmesg | egrep '(VMX/EPT|SVM/RVI)'
> > vmm0 at mainbus0: VMX/EPT
> > # vmctl show
> >    ID   PID VCPUS  MAXMEM  CURMEM     TTY        OWNER    STATE NAME
> >     2 17798     1    1.0G    519M   ttyp4         root  running debian
> >     1 89226     1    1.0G   1006M   ttyp2         root  running obsd
> >
> > Guest debian:
> > root@debian:~# lsb_release -a
> > No LSB modules are available.
> > Distributor ID: Debian
> > Description:    Debian GNU/Linux 12 (bookworm)
> > Release:        12
> > Codename:       bookworm
> >
> > I see a strange behavior on the guest debian.
> > With a simple 'sleep 2', I see that the sleep time is much more than 2
> secs.
> > Can be observed with:
> > root@debian:~# while [ 1 ]; do sleep 2; date; done
> >
> > On obsd guest, that is OpenBSD 7.4, sleep works as expected.
> >
> > Is this a bug of vmd?
>
> Clock sources can be an issue across host-VM combinations. I'd check what
> yours look like in the Linux VM:
>
> `cat /sys/devices/system/clocksource/clocksource0/available_clocksource`
>
> `cat /sys/devices/system/clocksource/clocksource0/current_clocksource`
>
> If that is the cause, there are a few ways to skin that cat. The approach
> that has worked well for me, and doesn't require installing any additional
> software on the guest side, is to append the following to the kernel boot
> parameters for the Linux VM:
>
> clocksource=tsc tsc=reliable
>
> In Alpine this is done with /etc/update-extlinux.conf and
> `update-extlinux`. I don't remember the details of Debian and its GRUB
> configuration, but I recall it being fairly straightforward.
>
> Brian Conway
> RCE Software, LLC
>
>

Reply via email to