Page MenuHomeFreeBSD

protosw: hide PR_FASTHZ / PR_SLOWHZ.
AbandonedPublic

Authored by melifaro on Jul 8 2022, 10:33 AM.
Tags
None
Referenced Files
F132357271: D35753.id.diff
Thu, Oct 16, 5:04 AM
Unknown Object (File)
Wed, Oct 15, 4:31 AM
Unknown Object (File)
Wed, Oct 15, 4:30 AM
Unknown Object (File)
Wed, Oct 15, 4:30 AM
Unknown Object (File)
Tue, Oct 14, 7:02 PM
Unknown Object (File)
Tue, Oct 14, 3:13 PM
Unknown Object (File)
Tue, Oct 14, 2:02 PM
Unknown Object (File)
Sun, Sep 28, 3:55 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 46320
Build 43209: arc lint + arc unit