Re: [PATCH v2 2/2] sched/fair: Trigger nohz.next_balance updates when a CPU goes NOHZ-idle

From: Dietmar Eggemann
Date: Tue Jul 20 2021 - 07:01:16 EST


On 19/07/2021 18:28, Valentin Schneider wrote:
> On 19/07/21 17:24, Dietmar Eggemann wrote:
>> On 19/07/2021 12:31, Valentin Schneider wrote:

[...]

>>> * Ensures that if we miss the CPU, we must see the has_blocked
>>> @@ -10531,6 +10540,8 @@ static void _nohz_idle_balance(struct rq *this_rq, unsigned int flags,
>>> if (need_resched()) {
>>> if (flags & NOHZ_STATS_KICK)
>>> has_blocked_load = true;
>>
>> This looks weird now? 'has_blocked_load = true' vs
>> 'WRITE_ONCE(nohz.needs_update, 1)'.
>>
>
> Well, has_blocked_load lets us factorize the nohz.has_blocked write
> (one is needed either when aborting or at the tail of the cpumask
> iteration), whereas there is just a single write for nohz.needs_update
> (when aborting).

You're right. Looks good then.

[...]