mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	Ingo Molnar <mingo@kernel.org>, Mike Galbraith <efault@gmx.de>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] sched/core: Fix kick offline cpu to do nohz idle load balance
Date: Mon, 10 Oct 2016 14:02:21 +0200	[thread overview]
Message-ID: <20161010120221.GP3568@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <CANRm+CzYkHmGyro1LvCUZfk=Yys2uSgn7ywVC-8SEifx4rM2PQ@mail.gmail.com>

On Mon, Oct 10, 2016 at 04:34:48PM +0800, Wanpeng Li wrote:
> > If there is a need to kick the idle load balancer, an ILB will be selected
> > to perform nohz idle load balance, however, if the selected ILB is in the
> > process of offline, smp_sched_reschedule() which generates a sched IPI will
> > splat as above.
> >
> >            CPU0                      CPU1
> >
> >                                  find_new_ilb()
> >     set_rq_offline()
> >                                  smp_sched_reschedule()  Oops
> >     nohz_balance_exit_idle()
> >
> > This patch fix it by exiting nohz idle balance before set cpu offline.
> 
>              CPU 0                       CPU1
> 
>                                           find_new_ilb()
>     nohz_balance_exit_idle()
>     set_rq_offline()
>                                           smp_sched_reschedule()
> 
> It seems that the patch still can't avoid this race, so any proposal
> is a great appreciated. :)


Not sure how this can happen, scheduler_tick() -> trigger_load_balance()
-> nohz_balancer_kick() is called with IRQs disabled, this too implies a
RCU-sched read side section.

And hotplug explicitly includes a rcu_sync_sched().

It would be find_new_ilb() is 'broken' in that it considers !active
CPUs. That's not immediately obvious.

      reply	other threads:[~2016-10-10 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  4:10 Wanpeng Li
2016-10-10  8:34 ` Wanpeng Li
2016-10-10 12:02   ` Peter Zijlstra [this message]

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=20161010120221.GP3568@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=kernellwp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wanpeng.li@hotmail.com \
    /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