Skip to content

RFC util/qemu-timer: Honor sub-ms poll timeouts on Darwin

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tests/bench: Add macos-pollbenchtests/bench/macos-pollbench.c tests/bench/meson.build+296 -00 replies
2/2util/qemu-timer: Honor sub-ms poll timeouts on Darwinutil/qemu-timer.c+27 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/2] util/qemu-timer: Honor sub-ms poll timeouts on Darwin

This series corrects a long-standing platform limitation:
qemu_poll_ns() promises nanosecond timeouts, but Darwin’s g_poll() fallback rounds up to milliseconds, making sub-ms virtual timers fire late. Fixes the observable behavior.

Add a Darwin-only microbenchmark used to compare wait primitives and justify the chosen approach.

During the final sub-ms sleep, descriptors are not polled, so fd readiness can be delayed by up to <1 ms. This is still much better than whole-ms timer overshoot and avoids busy-waiting.

Philippe Mathieu-Daudé (2):
tests/bench: Add macos-pollbench util/qemu-timer: Honor sub-ms poll timeouts on Darwin

 tests/bench/macos-pollbench.c | 290 ++++++++++++++++++++++++++++++++++
 util/qemu-timer.c             |  27 ++++
 tests/bench/meson.build       |   6 +
 3 files changed, 323 insertions(+)
 create mode 100644 tests/bench/macos-pollbench.c
Signature · 1 line
2.55.0