Re: [PATCH 0/2] avoid spurious blocked load update
From: Vincent Guittot
Date: Thu Nov 18 2021 - 09:40:45 EST
On Wed, 17 Nov 2021 at 00:48, Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx> wrote:
>
> On Fri, 2021-11-12 at 10:58 +0100, Vincent Guittot wrote:
> > This patchset is a follow up of :
> > https://lore.kernel.org/lkml/20211019123537.17146-1-vincent.guittot@xxxxxxxxxx/
> >
> > It ensures that newly idle load balance will not kick the update of
> > blocked load if it skips the load balance because avg_idle is too
> > short.
> > It also makes sure that rq->next_balance doesn't go in the past when
> > updated.
> >
> > Tim Chen (1):
> > sched: sched: Fix rq->next_balance time updated to earlier than
> > current time
> >
> > Vincent Guittot (1):
> > sched/fair: skip newidle update stats
> >
> > kernel/sched/fair.c | 25 ++++++++++++++++++++-----
> > 1 file changed, 20 insertions(+), 5 deletions(-)
> >
>
> Vincent,
>
> Got some data back from the benchmark team.
> To my surprise, the skip_new_idle_update_stats patch
> actually makes things a little worse.
>
> Relative Performance
> (higher better)
> 5.15 rc4 vanilla (cgroup disabled) 100%
> 5.15 rc4 vanilla (cgroup enabled) 96%
> patch v2 96%
> patch v3 96%
> patch v3
> +skip_new_idle_update_stats 93.7%
> patch v3
> +skip_new_idle_update_stats
> +Fix rq->next_balance_time 93.7%
>
Yeah, that looks surprising.
patch skip_new_idle_update_stats only ensures that the cpu will not
run an update of the blocked average of idle cpus before entering idle
but outside newidle_balance if it thinks that a task is about to wake
up soon.
The end result is that we run less often
_nohz_idle_balance(cpu_rq(cpu), NOHZ_STATS_KICK, CPU_IDLE); before
entering idle.
> The cpu utilization actually is the similar compared with
> having just the v3 patch. In both cases they are
> 81% user
> 12% kernel
> 2% idle
> 5% waiting for IO
>
>
> Profile on key functions
> in load balancing shows a little more cpu utilization,
> which is unexpected as we are cutting short
> the newidle_balance.
>
> patch v3
> 0.56% [k] __update_load_avg_cfs_rq
> 0.51% [k] update_load_avg
> 0.39% [k] update_blocked_averages
> 0.36% [k] __update_load_avg_se
> 0.05% [k] newidle_balance
>
> patch v3 + skip_new_idle_update_stats
> 0.58% [k] __update_load_avg_cfs_rq
> 0.53% [k] update_load_avg
> 0.40% [k] update_blocked_averages
> 0.37% [k] __update_load_avg_se
> 0.06% [k] newidle_balance
>
> Context switch frequency is lower by 4% with the skip_new_idle_update_stats
> patch.
>
> Thanks.
>
> Tim
>