lkml.org 
[lkml]   [2020]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched: pull tasks when CPU is about to run SCHED_IDLE tasks
Date
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

\
 
 \ /
  Last update: 2020-12-23 10:53    [W:0.070 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site