Re: [PATCH 1/6] sched/fair: remove update of blocked load from newidle_balance

From: Valentin Schneider
Date: Tue Feb 09 2021 - 08:10:37 EST


On 05/02/21 12:48, Vincent Guittot wrote:
> @@ -10517,16 +10499,11 @@ static void nohz_newidle_balance(struct rq *this_rq)
> time_before(jiffies, READ_ONCE(nohz.next_blocked)))
> return;
>

I was wondering whether all the conditions above were still relevant. I
think they are, but this one:

/* Will wake up very soon. No time for doing anything else*/
if (this_rq->avg_idle < sysctl_sched_migration_cost)
return;

should have its comment updated to something like:

/*
* Will wake up very soon. Blocked load will be updated
* periodically, no need to wake an idle CPU.
*/

given kick_ilb() isn't the costliest of things.

> - raw_spin_unlock(&this_rq->lock);
> /*
> - * This CPU is going to be idle and blocked load of idle CPUs
> - * need to be updated. Run the ilb locally as it is a good
> - * candidate for ilb instead of waking up another idle CPU.
> - * Kick an normal ilb if we failed to do the update.
> + * Blocked load of idle CPUs need to be updated.
> + * Kick an ILB to update statistics.
> */
> - if (!_nohz_idle_balance(this_rq, NOHZ_STATS_KICK, CPU_NEWLY_IDLE))
> - kick_ilb(NOHZ_STATS_KICK);
> - raw_spin_lock(&this_rq->lock);

With this change, the return value of _nohz_idle_balance() is no longer
used. This means we could get rid of the tracking of whether it iterated
over all nohz CPUs or not.

> + kick_ilb(NOHZ_STATS_KICK);
> }
>
> #else /* !CONFIG_NO_HZ_COMMON */