Skip to content

Commit 7d2180d

Browse files
author
Peter Zijlstra
committed
sched: Use set_next_task(.first) where required
Turns out the core_sched bits forgot to use the set_next_task(.first=true) variant. Notably: pick_next_task() := pick_task() + set_next_task(.first = true) Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 75b6499 commit 7d2180d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6010,7 +6010,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
60106010
next = rq->core_pick;
60116011
if (next != prev) {
60126012
put_prev_task(rq, prev);
6013-
set_next_task(rq, next);
6013+
set_next_task_first(rq, next);
60146014
}
60156015

60166016
rq->core_pick = NULL;
@@ -6184,7 +6184,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
61846184
}
61856185

61866186
out_set_next:
6187-
set_next_task(rq, next);
6187+
set_next_task_first(rq, next);
61886188
out:
61896189
if (rq->core->core_forceidle_count && next == rq->idle)
61906190
queue_core_balance(rq);

kernel/sched/sched.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,10 @@ static inline void set_next_task(struct rq *rq, struct task_struct *next)
23632363
next->sched_class->set_next_task(rq, next, false);
23642364
}
23652365

2366+
static inline void set_next_task_first(struct rq *rq, struct task_struct *next)
2367+
{
2368+
next->sched_class->set_next_task(rq, next, true);
2369+
}
23662370

23672371
/*
23682372
* Helper to define a sched_class instance; each one is placed in a separate

0 commit comments

Comments
 (0)