Skip to content

Commit 260598f

Browse files
author
Peter Zijlstra
committed
sched: Split up put_prev_task_balance()
With the goal of pushing put_prev_task() after pick_task() / into pick_next_task(). Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4686cc5 commit 260598f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/sched/core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5841,8 +5841,8 @@ static inline void schedule_debug(struct task_struct *prev, bool preempt)
58415841
schedstat_inc(this_rq()->sched_count);
58425842
}
58435843

5844-
static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
5845-
struct rq_flags *rf)
5844+
static void prev_balance(struct rq *rq, struct task_struct *prev,
5845+
struct rq_flags *rf)
58465846
{
58475847
#ifdef CONFIG_SMP
58485848
const struct sched_class *class;
@@ -5860,8 +5860,6 @@ static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
58605860
}
58615861
#endif
58625862

5863-
put_prev_task(rq, prev);
5864-
58655863
/*
58665864
* We've updated @prev and no longer need the server link, clear it.
58675865
* Must be done before ->pick_next_task() because that can (re)set
@@ -5917,7 +5915,8 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
59175915
}
59185916

59195917
restart:
5920-
put_prev_task_balance(rq, prev, rf);
5918+
prev_balance(rq, prev, rf);
5919+
put_prev_task(rq, prev);
59215920

59225921
for_each_class(class) {
59235922
p = class->pick_next_task(rq);
@@ -6017,7 +6016,8 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
60176016
goto out;
60186017
}
60196018

6020-
put_prev_task_balance(rq, prev, rf);
6019+
prev_balance(rq, prev, rf);
6020+
put_prev_task(rq, prev);
60216021

60226022
smt_mask = cpu_smt_mask(cpu);
60236023
need_sync = !!rq->core->core_cookie;

0 commit comments

Comments
 (0)