-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix preemption algorithm to reduce the number of preemptions #1979
Conversation
/cc @alculquicondor |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
if isQueueExhaustedForAllRequestedFlavors(&wl, assignment, cq) { | ||
return minimalPreemptions(&wl, assignment, snapshot, resPerFlv, sameQueueCandidates, true, nil) | ||
} | ||
|
||
targets := minimalPreemptions(&wl, assignment, snapshot, resPerFlv, candidates, false, nil) | ||
if len(targets) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still reaching this branch with any of the test cases? In particular, for reclaimWithinCohort: Any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm tempted to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have a failing unit test in preemption_test.go
: "preempting locally and borrowing other resources in cohort, without cohort candidates" (yes it is using reclaimWithinCohort: LowerPriority
, but I checked that it also fails if we change reclaimWithinCohort
to Any
.
I would suggest keeping it (at least in this PR, and probably its removal would require a feature gate).
However, your comment prompted me to think of a cleaner code structure, so that return minimalPreemptions(wlReq, cq, assignment, snapshot, resPerFlv, sameQueueCandidates, true, nil)
appears only once in code. PTAL.
f543566
to
1d42262
Compare
1d42262
to
4d5ff9d
Compare
Co-authored-by: Aldo Culquicondor <[email protected]>
Co-authored-by: Aldo Culquicondor <[email protected]>
Co-authored-by: Aldo Culquicondor <[email protected]>
677cbe6
to
7ca5892
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
LGTM label has been added. Git tree hash: 3056eeffb692abb2029f27bed48374df8e635da4
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, mimowo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/release-note-edit
|
@alculquicondor: /release-note-edit must be used with a release note block. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/release-note-edit
|
/cherry-pick release-0.6 |
@alculquicondor: once the present PR merges, I will cherry-pick it on top of release-0.6 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@alculquicondor: #1979 failed to apply on top of branch "release-0.6":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…tes-sigs#1979) * Fix preemption algorithm to reduce the number of preemptions * review * Update pkg/scheduler/preemption/preemption_test.go Co-authored-by: Aldo Culquicondor <[email protected]> * Update pkg/scheduler/preemption/preemption_test.go Co-authored-by: Aldo Culquicondor <[email protected]> * Update pkg/scheduler/preemption/preemption_test.go Co-authored-by: Aldo Culquicondor <[email protected]> * remarks2 --------- Co-authored-by: Aldo Culquicondor <[email protected]>
…tes-sigs#1979) * Fix preemption algorithm to reduce the number of preemptions * review * Update pkg/scheduler/preemption/preemption_test.go Co-authored-by: Aldo Culquicondor <[email protected]> * Update pkg/scheduler/preemption/preemption_test.go Co-authored-by: Aldo Culquicondor <[email protected]> * Update pkg/scheduler/preemption/preemption_test.go Co-authored-by: Aldo Culquicondor <[email protected]> * remarks2 --------- Co-authored-by: Aldo Culquicondor <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1974
Special notes for your reviewer:
Does this PR introduce a user-facing change?