Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Pavel Tatashin
That's why page_alloc_init_late() needs spin_lock_irq(). If a CPU is holding deferred_zone_grow_lock with enabled interrupts and an interrupt comes in on that CPU and the CPU runs deferred_grow_zone() in its interrupt handler, we deadlock. lockdep knows about this bug and should have reported

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Pavel Tatashin
That's why page_alloc_init_late() needs spin_lock_irq(). If a CPU is holding deferred_zone_grow_lock with enabled interrupts and an interrupt comes in on that CPU and the CPU runs deferred_grow_zone() in its interrupt handler, we deadlock. lockdep knows about this bug and should have reported

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Andrew Morton
On Tue, 6 Mar 2018 16:04:06 -0500 Pavel Tatashin wrote: > > > > > spin_lock(_zone_grow_lock); > > > > > - static_branch_disable(_pages); > > > > > + deferred_zone_grow = false; > > > > > spin_unlock(_zone_grow_lock); > > > > > +

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Andrew Morton
On Tue, 6 Mar 2018 16:04:06 -0500 Pavel Tatashin wrote: > > > > > spin_lock(_zone_grow_lock); > > > > > - static_branch_disable(_pages); > > > > > + deferred_zone_grow = false; > > > > > spin_unlock(_zone_grow_lock); > > > > > + static_branch_disable(_pages); > > > > > >

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Pavel Tatashin
> > > > spin_lock(_zone_grow_lock); > > > > - static_branch_disable(_pages); > > > > + deferred_zone_grow = false; > > > > spin_unlock(_zone_grow_lock); > > > > + static_branch_disable(_pages); > > > > > > > > /* There will be num_node_state(N_MEMORY) threads */ > > >

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Pavel Tatashin
> > > > spin_lock(_zone_grow_lock); > > > > - static_branch_disable(_pages); > > > > + deferred_zone_grow = false; > > > > spin_unlock(_zone_grow_lock); > > > > + static_branch_disable(_pages); > > > > > > > > /* There will be num_node_state(N_MEMORY) threads */ > > >

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Andrew Morton
On Tue, 6 Mar 2018 15:48:26 -0500 Pavel Tatashin wrote: > On Tue, Mar 6, 2018 at 3:36 PM, Andrew Morton > wrote: > > > On Tue, 6 Mar 2018 14:20:22 -0500 Pavel Tatashin < > > pasha.tatas...@oracle.com> wrote: > > > > >

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Andrew Morton
On Tue, 6 Mar 2018 15:48:26 -0500 Pavel Tatashin wrote: > On Tue, Mar 6, 2018 at 3:36 PM, Andrew Morton > wrote: > > > On Tue, 6 Mar 2018 14:20:22 -0500 Pavel Tatashin < > > pasha.tatas...@oracle.com> wrote: > > > > > spin_lock(_zone_grow_lock); > > > -

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Andrew Morton
On Tue, 6 Mar 2018 14:20:22 -0500 Pavel Tatashin wrote: > Robot reported this issue: > https://lkml.org/lkml/2018/2/27/851 > > That is introduced by: > mm: initialize pages on demand during boot > > The problem is caused by changing static branch value within spin

Re: [PATCH] mm: might_sleep warning

2018-03-06 Thread Andrew Morton
On Tue, 6 Mar 2018 14:20:22 -0500 Pavel Tatashin wrote: > Robot reported this issue: > https://lkml.org/lkml/2018/2/27/851 > > That is introduced by: > mm: initialize pages on demand during boot > > The problem is caused by changing static branch value within spin lock. > Spin lock disables