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
Open
@pevik

Description

@pevik

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0