All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Introduce util_est boost
@ 2022-04-25 11:42 Qing Wang
  0 siblings, 0 replies; only message in thread
From: Qing Wang @ 2022-04-25 11:42 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, linux-kernel
  Cc: Wang Qing

From: Wang Qing <wangqing@vivo.com>

Util_avg is greater than util_est means there is a sudden increase in
tasks at this time, we should give it an increment to make load balancing
faster.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 kernel/sched/fair.c     | 8 +++++++-
 kernel/sched/features.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 265bf7a75a37..2fcda7972057 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4036,7 +4036,13 @@ static inline unsigned long _task_util_est(struct task_struct *p)
 
 static inline unsigned long task_util_est(struct task_struct *p)
 {
-	return max(task_util(p), _task_util_est(p));
+	unsigned long util_avg = task_util(p);
+	unsigned long util_est = _task_util_est(p);
+
+	if (sched_feat(UTIL_EST_BOOST) && util_est && util_avg > util_est)
+		return util_avg + (util_avg - util_est)/2;
+	else
+		return util_est?util_est:util_avg;
 }
 
 #ifdef CONFIG_UCLAMP_TASK
diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index 1cf435bbcd9c..c73a898e7e38 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -95,6 +95,7 @@ SCHED_FEAT(WA_BIAS, true)
  */
 SCHED_FEAT(UTIL_EST, true)
 SCHED_FEAT(UTIL_EST_FASTUP, true)
+SCHED_FEAT(UTIL_EST_BOOST, false)
 
 SCHED_FEAT(LATENCY_WARN, false)
 
-- 
2.27.0.windows.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-25 11:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 11:42 [PATCH] sched: Introduce util_est boost Qing Wang

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.