3 ms·
Hey, yeah, they are using CLOCK_MONOTONIC for the event loop exactly for that. I think it might be possible to fix the SO_TIMESTAMP wall-clock problem by using
by majke 3y ago
Hey, yeah, they are using CLOCK_MONOTONIC for the event loop exactly for that.
I think it might be possible to fix the SO_TIMESTAMP wall-clock problem by using it not to measure duration between ping send and ping receive, but to measure kernel-userspace latency only. That is: measure ping send/recv with MONOTONIC, and subtract the kernel-to-userspace delay from that measurement to reduce jitter. The kernel-to-userspace delay can be done using SO_TIMESTAMP + wall clock.
With such algo only the time change in the very short window between kernel-to-userspace would impact the readings.
Another semi-related issue https://github.com/iputils/iputils/issues/480 https://github.com/iputils/iputils/issues/480