Skip to content
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: high priority job of two tasks cannot preempt low priority job of one task #2775

Merged
merged 1 commit into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/scheduler/util/scheduler_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ func GetNodeList(nodes map[string]*api.NodeInfo, nodeList []string) []*api.NodeI

// ValidateVictims returns an error if the resources of the victims can't satisfy the preemptor
func ValidateVictims(preemptor *api.TaskInfo, node *api.NodeInfo, victims []*api.TaskInfo) error {
if len(victims) == 0 {
return fmt.Errorf("no victims")
}
// Victims should not be judged to be empty here.
// It is possible to complete the scheduling of the preemptor without evicting the task.
// In the first round, a large task (CPU: 8) is expelled, and a small task is scheduled (CPU: 2)
// When the following rounds of victims are empty, it is still allowed to schedule small tasks (CPU: 2)
futureIdle := node.FutureIdle()
for _, victim := range victims {
futureIdle.Add(victim.Resreq)
Expand Down