mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brendan Jackman <brendan.jackman@arm.com>
To: Todd Kjos <tkjos@android.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Morten Rasmussen <morten.rasmussen@arm.com>
Subject: Re: [PATCH 1/2] sched: force update of blocked load of idle cpus
Date: Fri, 10 Nov 2017 14:53:12 +0000	[thread overview]
Message-ID: <87k1yydw2v.fsf@arm.com> (raw)
In-Reply-To: <CAD0t5oPxXc1XARh8puEThJQYfRNFAc2Su0Bj1bDH7_77MVczzA@mail.gmail.com>


Hi Todd,

On Thu, Nov 09 2017 at 19:56, Todd Kjos wrote:
>> @@ -8683,6 +8692,10 @@ static void nohz_balancer_kick(void)
>>
>>         if (test_and_set_bit(NOHZ_BALANCE_KICK, nohz_flags(ilb_cpu)))
>>                 return;
>> +
>> +       if (only_update)
>> +               set_bit(NOHZ_STATS_KICK, nohz_flags(ilb_cpu));
>
> Should there be an "else clear_bit(NOHZ_STATS_KICK, nohz_flags(ilb_cpu));" ?
>
> Seems like any time this is called as !only_update, we should stop
> inhibiting rebalance. In fact, we should perhaps go a little further
> so that an only_update never inhibits rebalance from a concurrent
> !only_update.

Yes, I think you are essentially right. To make sure I understand you: I
guess you are saying that where two CPUs are concurrently in
nohz_balancer_kick, one with only_update=1 and one with only_update=0,
the former should not prevent the latter from triggering a full load
balance. (I'm assuming they both get the same value for ilb_cpu).

The exact solution you described won't work: only one of those CPUs can
get to this line of code, because of the test_and_set_bit above. So I
think we need something like:

       if (test_and_set_bit(NOHZ_BALANCE_KICK, nohz_flags(ilb_cpu))) {
               if (!only_update) {
                      /*
                       * There's a pending stats kick or an ongoing
                       * nohz_idle balance that's just for stats.
                       * Convert it to a proper nohz balance.
                       */
                      clear_bit(NOHZ_STATS_KICK, nohz_flags(ilb_cpu));
               }
               return;
       }

       if (only_update)
               set_bit(NOHZ_STATS_KICK, nohz_flags(ilb_cpu));

There's still scope for some lost rebalance_domains calls, but as
Vincent pointed out in a recent chat, because the rq->next_balance
fields won't be changed for the CPUs they get missed out, those will
only be delayed until the next scheduler_tick.

I'm on holiday ATM, I'll get to testing that when I get back.

Thanks for the review,
Brendan

  reply	other threads:[~2017-11-10 14:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 12:25 [PATCH 0/2] sched/fair: remote load updates for idle CPUs Brendan Jackman
2017-10-24 12:25 ` [PATCH 1/2] sched: force update of blocked load of idle cpus Brendan Jackman
2017-11-09 19:56   ` Todd Kjos
2017-11-10 14:53     ` Brendan Jackman [this message]
2017-11-20  9:04   ` Vincent Guittot
2017-11-30 15:59     ` Brendan Jackman
2017-10-24 12:25 ` [PATCH 2/2] sched/fair: Update blocked load from newly idle balance Brendan Jackman
2017-11-20  9:07   ` Vincent Guittot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1yydw2v.fsf@arm.com \
    --to=brendan.jackman@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=tkjos@android.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome