diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-11-11 08:34:59 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-11-11 08:34:59 +0100 |
commit | 6d5a763c303bc9d78b17361d30b692ba2facf9b4 (patch) | |
tree | 1ba7059e8b1c47eb075acc906f8ef01f9c490ba1 /kernel/sched/stop_task.c | |
parent | leds: Use vtime aware kcpustat accessor to fetch CPUTIME_SYSTEM (diff) | |
parent | Linux 5.4-rc7 (diff) | |
download | linux-6d5a763c303bc9d78b17361d30b692ba2facf9b4.tar.xz linux-6d5a763c303bc9d78b17361d30b692ba2facf9b4.zip |
Merge tag 'v5.4-rc7' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/stop_task.c')
-rw-r--r-- | kernel/sched/stop_task.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c index 7e1cee4e65b2..c0640739e05e 100644 --- a/kernel/sched/stop_task.c +++ b/kernel/sched/stop_task.c @@ -15,6 +15,12 @@ select_task_rq_stop(struct task_struct *p, int cpu, int sd_flag, int flags) { return task_cpu(p); /* stop tasks as never migrate */ } + +static int +balance_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) +{ + return sched_stop_runnable(rq); +} #endif /* CONFIG_SMP */ static void @@ -31,16 +37,13 @@ static void set_next_task_stop(struct rq *rq, struct task_struct *stop) static struct task_struct * pick_next_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) { - struct task_struct *stop = rq->stop; - WARN_ON_ONCE(prev || rf); - if (!stop || !task_on_rq_queued(stop)) + if (!sched_stop_runnable(rq)) return NULL; - set_next_task_stop(rq, stop); - - return stop; + set_next_task_stop(rq, rq->stop); + return rq->stop; } static void @@ -60,7 +63,7 @@ static void yield_task_stop(struct rq *rq) BUG(); /* the stop task should never yield, its pointless. */ } -static void put_prev_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) +static void put_prev_task_stop(struct rq *rq, struct task_struct *prev) { struct task_struct *curr = rq->curr; u64 delta_exec; @@ -129,6 +132,7 @@ const struct sched_class stop_sched_class = { .set_next_task = set_next_task_stop, #ifdef CONFIG_SMP + .balance = balance_stop, .select_task_rq = select_task_rq_stop, .set_cpus_allowed = set_cpus_allowed_common, #endif |