Page MenuHomeFreeBSD

protosw: hide PR_FASTHZ / PR_SLOWHZ.
AbandonedPublic

Authored by melifaro on Jul 8 2022, 10:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 24, 6:08 PM
Unknown Object (File)
Fri, Apr 18, 6:54 PM
Unknown Object (File)
Fri, Apr 18, 2:45 PM
Unknown Object (File)
Mon, Apr 7, 9:32 PM
Unknown Object (File)
Sun, Apr 6, 12:24 AM
Unknown Object (File)
Feb 10 2025, 3:47 AM
Unknown Object (File)
Feb 5 2025, 5:33 AM
Unknown Object (File)
Jan 28 2025, 4:02 AM
Subscribers

Details

Reviewers
None
Group Reviewers
network
Summary

Use newly-added time conversion functions instead of direct PR_FASTHZ / PR_SLOWHZ access

Exact amount of ticks for PR_FASTHZ / PR_SLOWHZ is an implementation detail of the domain/protosw subsystem. Exposing these values directly leads to complications / broken assumptions in the code.
When exposed, these time units propagate farther to the code and it's hard to understand whether it's seconds, ticks, slow ticks, fast ticks and so on.
Some of the user-visible constants are even defined in these slow/fast ticks, making it harder to reason about.

Some of the assumptions (like (PR_FASTHZ / 2) /* 500ms */) are tied to the specific value of the constant and will fail if/when it's changed.

Address this by adding milli_to_<slow|fast>timo() functions, allowing to express the desired delay in milliseconds.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46319
Build 43208: arc lint + arc unit