All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: pull tasks when CPU is about to run SCHED_IDLE tasks
@ 2020-12-23  8:09 ultrachin
  2020-12-23 11:30 ` Vincent Guittot
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: ultrachin @ 2020-12-23  8:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, heddchen, xiaoggchen

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



^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-02-04 17:05 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23  8:09 [PATCH] sched: pull tasks when CPU is about to run SCHED_IDLE tasks ultrachin
2020-12-23 11:30 ` Vincent Guittot
2021-01-11  8:26   ` chin
2021-01-11 11:04     ` Vincent Guittot
2021-01-12  6:57       ` chin
2021-01-12  8:18         ` Vincent Guittot
2021-01-13  3:12           ` chin
2021-01-13  8:30             ` Vincent Guittot
2021-02-02  7:54               ` chin
2021-02-02 15:54                 ` Vincent Guittot
2021-02-03  2:53                   ` chin
2021-02-04  3:57                     ` Jiang Biao
2021-02-04  8:03                       ` Vincent Guittot
2021-02-04  8:01                 ` Vincent Guittot
2021-02-04  8:52                   ` chin
2021-02-04  9:02                     ` Vincent Guittot
2021-02-04  9:13                   ` Jiang Biao
2021-01-11  9:15   ` He Chen
2020-12-27 19:13 ` kernel test robot
2020-12-27 19:13   ` kernel test robot
2020-12-27 19:42 ` kernel test robot
2020-12-27 19:42   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.