HomeFreeBSD

runq: Revamp runq_find*(), new runq_find_range()

Description

runq: Revamp runq_find*(), new runq_find_range()

Rename existing functions to use the simpler prefix 'runq_findq' instead
of 'runq_findbit' (that they work on top of bit runs is an
implementation detail).

Add runq_findq_range(), which takes a range of indices to operate on
(bounds included). This is in preparation for changing ULE to use
a single runqueue, since it needs to treat the timesharing range
differently.

Rename runq_findbit_from() to runq_findq_circular(), which is more
descriptive.

To reduce code duplication, have runq_findq() and runq_findq_circular()
leverage runq_findq_range() internally. For the latter, this also
brings a small algorithmic improvement, since previously the second pass
(from queue 0) would cover the whole runqueue if it was completely
empty, scanning again empty queues after the start index.

Reviewed by: kib
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45387

(cherry picked from commit 439dc920f2d88e3fe2869a2845f15d8ab44cc051)

Details

Provenance
olceAuthored on Feb 29 2024, 8:57 AM
Reviewer
kib
Differential Revision
D45387: runq: API rationalization, code factorization, revised implementation
Parents
rG606087082472: runq: Re-order functions more logically
Branches
Unknown
Tags
Unknown