(forgot to Cc Akihiko)
On 20/11/26 00:34, Philippe Mathieu-Daudé wrote:
> 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
>