Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1498261

Re: [PATCH] sched/core: Fix kick offline cpu to do nohz idle load balance

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] sched/core: Fix kick offline cpu to do nohz idle load balance
Date 2016-10-10 14:30 +0200
Message-ID <sqHSp-1dv-13@gated-at.bofh.it> (permalink)
References <sqAed-4Wd-1@gated-at.bofh.it> <sqEBb-7uz-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] sched/core: Fix kick offline cpu to do nohz idle load balance Wanpeng Li <kernellwp@gmail.com> - 2016-10-10 06:20 +0200
  Re: [PATCH] sched/core: Fix kick offline cpu to do nohz idle load balance Wanpeng Li <kernellwp@gmail.com> - 2016-10-10 11:00 +0200
    Re: [PATCH] sched/core: Fix kick offline cpu to do nohz idle load  balance Peter Zijlstra <peterz@infradead.org> - 2016-10-10 14:30 +0200

csiph-web