Make htex scale_in pick longest idle blocks #3135
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.
Prior to this, scale_in picked the shortest-idle (i.e. most recently used but now idle) blocks.
In the scaling code right now, there isn't any particular reason to order idle blocks in any particular order...
... but the next PR following on from this one will also consider unstarted blocks with infinite idle time, and in that situation, the policy will be that unstarted idle blocks should be scaled down in preference to currently running blocks. (other policies are possible and reasonable but not addressed by either this PR or the upcoming PR)
I think this was intended to work this way to begin with (although I'm unsure of the justification) but there is a sign error that is flipped by this PR.
@yadudoc or @ZhuozhaoLi do you have any insight into the purpose of this sorting?
Changed Behaviour
Block scale in order is changed - I don't think that will bother people.
Type of change