1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 17:07:47 +00:00

Ports/qemu: Use the coarse monotonic clock for timing CPU ticks

While this loses quite a bit of accuracy (although to no apparent
decrease in emulation quality) , it helps avoiding the additional
overhead of the `clock_gettime` syscall (as `CLOCK_MONOTONIC_COARSE`
is forwarded using the mapped time page) and we don't have to do a
HPET timer read for each tick.

This results in a decrease of Serenity boot time from 1h16m down to
42m when running on Serenity.
This commit is contained in:
Tim Schumacher 2022-07-28 08:31:21 +02:00 committed by Brian Gianforcaro
parent a934fa3d28
commit be6b3710c8
4 changed files with 39 additions and 2 deletions

View file

@ -12,3 +12,13 @@ Extend short scan sets into the full list
We don't support the (apparently nonstandard) short variant of scan
sets, so extend them into a full list manually.
## `0003-Use-the-coarse-monotonic-clock-for-timing-CPU-ticks.patch`
Use the coarse monotonic clock for timing CPU ticks
While this loses quite a bit of accuracy (although to no apparent
decrease in emulation quality), it helps avoiding the additional
overhead of the `clock_gettime` syscall (as `CLOCK_MONOTONIC_COARSE`
is forwarded using the mapped time page) and we don't have to do a
HPET timer read for each tick.