scx_layered: Add MATCH_NICE_EQUALS match kind #149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a usecase where specific nice values are used to bucket tasks into groups that are handled separately by different
scx_layered
policies, with no implications of relative priority between niceness X, X + 1, X - 1, etc. In other words, nicevals are used as simple tags in this scenario.If we wanted to treat a specific niceness this way e.g.
11
, we could do so with AND'd MATCH_NICE_{ABOVE,BELOW} like so:But this is unnecessarily verbose and doesn't communicate the intent of the match very well. Adding a
NiceEquals
matcher simplifies the config and makes intent obvious:This PR adds support for such a matcher.
Also, rename
layer_match.nice_above_or_below
to justlayer_match.nice
, as the former doesn't describe the newly-added matcher's use of the field. It's still obvious thatlayer_match.nice
is relevant to MATCH_NICE_{ABOVE, BELOW, EQUALS}.