Messages in this thread Patch in this message | | | From | ultrachin@163 ... | Subject | [PATCH] sched: pull tasks when CPU is about to run SCHED_IDLE tasks | Date | Wed, 23 Dec 2020 16:09:28 +0800 |
| |
From: Chen Xiaoguang <xiaoggchen@tencent.com>
Before a CPU switches from running SCHED_NORMAL task to SCHED_IDLE task, trying to pull SCHED_NORMAL tasks from other CPU by doing load_balance first.
Signed-off-by: Chen Xiaoguang <xiaoggchen@tencent.com> Signed-off-by: Chen He <heddchen@tencent.com> --- kernel/sched/fair.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ae7ceba..0a26132 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7004,6 +7004,11 @@ struct task_struct * struct task_struct *p; int new_tasks; + if (prev && + fair_policy(prev->policy) && + sched_idle_cpu(rq->cpu)) + goto idle; + again: if (!sched_fair_runnable(rq)) goto idle; -- 1.8.3.1
| |