Re: [RFC PATCH 2/5] sched: Add NOHZ_STATS_KICK
From: Peter Zijlstra
Date: Thu Feb 01 2018 - 13:10:56 EST
On Wed, Jan 24, 2018 at 09:25:36AM +0100, Vincent Guittot wrote:
> @@ -8861,7 +8875,14 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf)
> update_next_balance(sd, &next_balance);
> rcu_read_unlock();
>
> - if (time_after(jiffies, next) && atomic_read(&nohz.stats_state))
> + /*
> + * Update blocked idle load if it has not been done for a
> + * while. Try to do it locally before entering idle but kick a
> + * ilb if it takes too much time and might delay next local
> + * wake up
> + */
> + if (time_after(jiffies, next) && atomic_read(&nohz.stats_state) &&
> + !_nohz_idle_balance(this_rq, NOHZ_STATS_KICK, CPU_NEWLY_IDLE))
> kick_ilb(NOHZ_STATS_KICK);
>
> goto out;
This I really dislike. We're here because avg_idle is _really_ low, we
really should not then call _nohz_idle_balance().