Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Michal Hocko
On Tue 04-07-17 14:48:56, Thomas Gleixner wrote: > On Tue, 4 Jul 2017, Michal Hocko wrote: > > On Tue 04-07-17 11:32:33, Thomas Gleixner wrote: > > > The rework of the cpu hotplug locking unearthed potential deadlocks with > > > the memory hotplug locking code. > > > > > > The solution for these

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Michal Hocko
On Tue 04-07-17 14:48:56, Thomas Gleixner wrote: > On Tue, 4 Jul 2017, Michal Hocko wrote: > > On Tue 04-07-17 11:32:33, Thomas Gleixner wrote: > > > The rework of the cpu hotplug locking unearthed potential deadlocks with > > > the memory hotplug locking code. > > > > > > The solution for these

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Michal Hocko wrote: > On Tue 04-07-17 11:32:33, Thomas Gleixner wrote: > > The rework of the cpu hotplug locking unearthed potential deadlocks with > > the memory hotplug locking code. > > > > The solution for these is to rework the memory hotplug locking code as well > > and

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Michal Hocko wrote: > On Tue 04-07-17 11:32:33, Thomas Gleixner wrote: > > The rework of the cpu hotplug locking unearthed potential deadlocks with > > the memory hotplug locking code. > > > > The solution for these is to rework the memory hotplug locking code as well > > and

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Vlastimil Babka wrote: > > > > -void lru_add_drain_all(void) > > +void lru_add_drain_all_cpuslocked(void) > > { > > static DEFINE_MUTEX(lock); > > static struct cpumask has_work; > > @@ -701,7 +701,6 @@ void lru_add_drain_all(void) > > return; > > > >

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Vlastimil Babka wrote: > > > > -void lru_add_drain_all(void) > > +void lru_add_drain_all_cpuslocked(void) > > { > > static DEFINE_MUTEX(lock); > > static struct cpumask has_work; > > @@ -701,7 +701,6 @@ void lru_add_drain_all(void) > > return; > > > >

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Vlastimil Babka
On 07/04/2017 11:32 AM, Thomas Gleixner wrote: > The rework of the cpu hotplug locking unearthed potential deadlocks with > the memory hotplug locking code. > > The solution for these is to rework the memory hotplug locking code as well > and take the cpu hotplug lock before the memory hotplug

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Vlastimil Babka
On 07/04/2017 11:32 AM, Thomas Gleixner wrote: > The rework of the cpu hotplug locking unearthed potential deadlocks with > the memory hotplug locking code. > > The solution for these is to rework the memory hotplug locking code as well > and take the cpu hotplug lock before the memory hotplug

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Michal Hocko
On Tue 04-07-17 11:32:33, Thomas Gleixner wrote: > The rework of the cpu hotplug locking unearthed potential deadlocks with > the memory hotplug locking code. > > The solution for these is to rework the memory hotplug locking code as well > and take the cpu hotplug lock before the memory hotplug

Re: [patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Michal Hocko
On Tue 04-07-17 11:32:33, Thomas Gleixner wrote: > The rework of the cpu hotplug locking unearthed potential deadlocks with > the memory hotplug locking code. > > The solution for these is to rework the memory hotplug locking code as well > and take the cpu hotplug lock before the memory hotplug

[patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Thomas Gleixner
The rework of the cpu hotplug locking unearthed potential deadlocks with the memory hotplug locking code. The solution for these is to rework the memory hotplug locking code as well and take the cpu hotplug lock before the memory hotplug lock in mem_hotplug_begin(), but this will cause a

[patch V2 1/2] mm: swap: Provide lru_add_drain_all_cpuslocked()

2017-07-04 Thread Thomas Gleixner
The rework of the cpu hotplug locking unearthed potential deadlocks with the memory hotplug locking code. The solution for these is to rework the memory hotplug locking code as well and take the cpu hotplug lock before the memory hotplug lock in mem_hotplug_begin(), but this will cause a