8000 ping RTT: replace gettimeofday() to CLOCK_MONOTONIC, struct timespec, clock_gettime() · Issue #587 · iputils/iputils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ping RTT: replace gettimeofday() to CLOCK_MONOTONIC, struct timespec, clock_gettime() #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pevik opened this issue May 9, 2025 · 0 comments 8000

Comments

@pevik
Copy link
Contributor
pevik commented May 9, 2025

CLOCK_MONOTONIC is much better for measuring elapsed time. This would improve the reliability of RTTs at the current microsecond precision by avoiding wall-clock issues (no jumps forward or even back). And also fix occasional deadlock: #276 (comment).

This has been suggested in the past () to fix the deadlock and currently raised again when handle #584 (#585 (comment)).

There were in the past attempts to implement it just to avoid the dedlock: old https://lore.kernel.org/netdev/alpine.DEB.1.10.1009051453090.13886@red.crap.retrofitta.se/ and newer #278.

CLOCK_MONOTONIC_RAW is already used in other parts in ping (together with gettimeofday()). I'm not sure why @kerolasa haven't converted everything. Moving CLOCK_MONOTONIC_RAW to CLOCK_MONOTONIC should be reconsidered.

CLOCK_MONOTONIC is used in arping, clockdiff, tracpeath (converted from CLOCK_MONOTONIC_RAW in da9a610).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0