public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Minor making update_blocked_load_status() be able to set has_blocked_load to 1
@ 2022-04-03 16:33 Tao Zhou
  0 siblings, 0 replies; only message in thread
From: Tao Zhou @ 2022-04-03 16:33 UTC (permalink / raw)
  To: linux-kernel, tao.zhou

I realize that newidle_balance() can not set rq->has_blocked_load to 1
when it has block load. When no task pulled then nohz_newidle_balance()
will set flag NOHZ_NEWILB_KICK to trigger ILB. In do_idle(),
nohz_run_idle_balance() will call _nohz_idle_balance() to update status
using update_nohz_stats() to make sure there has blocked load. If it is
not set in newidle_balance(), update_nohz_stats() will exit early and do
not do update_blocked_averages()(time spent from newidle_balance() to
update_nohz_stats will not be used to update load avg). There has
chance to call cpuidle_idle_call() to set  has_blocked_load to 1 and
can also update later but if cpuidle_idle_call() is not called, the
lost update in nohz_run_idle_balance() will not be permitted that me not
thoroughly think. I know this is likely a invalid commit log.
---
 kernel/sched/fair.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5146163bfabb..fc8765792a77 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8091,7 +8091,9 @@ static inline void update_blocked_load_tick(struct rq *rq)
 
 static inline void update_blocked_load_status(struct rq *rq, bool has_blocked)
 {
-	if (!has_blocked)
+	if (has_blocked)
+		rq->has_blocked_load = 1;
+	else
 		rq->has_blocked_load = 0;
 }
 #else
@@ -10597,7 +10599,7 @@ void nohz_balance_enter_idle(int cpu)
 	 * If a clear happens, it will have evaluated last additions because
 	 * rq->lock is held during the check and the clear
 	 */
-	rq->has_blocked_load = 1;
+	update_blocked_load_status(rq, 1);
 
 	/*
 	 * The tick is still stopped but load could have been added in the
-- 
2.35.1


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

only message in thread, other threads:[~2022-04-03 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-03 16:33 [PATCH] sched/fair: Minor making update_blocked_load_status() be able to set has_blocked_load to 1 Tao Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox