[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191108131909.545730862@infradead.org>
Date: Fri, 08 Nov 2019 14:15:56 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: mingo@...nel.org, vincent.guittot@...aro.org,
dietmar.eggemann@....com, juri.lelli@...hat.com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de
Cc: linux-kernel@...r.kernel.org, qperret@...gle.com,
valentin.schneider@....com, qais.yousef@....com,
ktkhai@...tuozzo.com, peterz@...radead.org
Subject: [PATCH 3/7] sched: Make pick_next_task_idle() more consistent
Only pick_next_task_fair() needs the @prev and @rf argument; these are
required to implement the cpu-cgroup optimization. None of the other
pick_next_task() methods need this. Make pick_next_task_idle() more
consistent.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
kernel/sched/core.c | 6 ++++--
kernel/sched/idle.c | 3 +--
2 files changed, 5 insertions(+), 4 deletions(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3922,8 +3922,10 @@ pick_next_task(struct rq *rq, struct tas
goto restart;
/* Assumes fair_sched_class->next == idle_sched_class */
- if (unlikely(!p))
- p = idle_sched_class.pick_next_task(rq, prev, rf);
+ if (unlikely(!p)) {
+ put_prev_task(rq, prev);
+ p = idle_sched_class.pick_next_task(rq, NULL, NULL);
+ }
return p;
}
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -390,8 +390,7 @@ pick_next_task_idle(struct rq *rq, struc
{
struct task_struct *next = rq->idle;
- if (prev)
- put_prev_task(rq, prev);
+ WARN_ON_ONCE(prev || rf);
set_next_task_idle(rq, next);
Powered by blists - more mailing lists