From a17850845567e982f0f4635e6d3af2e349513b5e Mon Sep 17 00:00:00 2001 From: Hamad Al Marri Date: Sun, 14 Nov 2021 03:52:19 +0300 Subject: [PATCH] update_blocked_averages in trigger_loadbalancer every 19ms instead of every tick. --- kernel/sched/bs.c | 11 ++++++++++- kernel/sched/bs_nohz.h | 2 -- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/kernel/sched/bs.c b/kernel/sched/bs.c index 0b289f655e65e..758cd410d6e6d 100644 --- a/kernel/sched/bs.c +++ b/kernel/sched/bs.c @@ -1058,7 +1058,16 @@ void trigger_load_balance(struct rq *this_rq) if (unlikely(on_null_domain(this_rq) || !cpu_active(cpu_of(this_rq)))) return; - update_blocked_averages(this_rq->cpu); +#ifdef CONFIG_TT_ACCOUNTING_STATS + if (time_after_eq(jiffies, this_rq->next_balance)) { + /* scale ms to jiffies */ + unsigned long interval = msecs_to_jiffies(19); + + this_rq->next_balance = jiffies + interval; + update_blocked_averages(this_rq->cpu); + } +#endif + nohz_balancer_kick(this_rq); } diff --git a/kernel/sched/bs_nohz.h b/kernel/sched/bs_nohz.h index 3802951591f36..89466954743c3 100644 --- a/kernel/sched/bs_nohz.h +++ b/kernel/sched/bs_nohz.h @@ -686,6 +686,4 @@ static __latent_entropy void run_rebalance_domains(struct softirq_action *h) */ if (nohz_idle_balance(this_rq, idle)) return; - - update_blocked_averages(this_rq->cpu); }