Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-03 Thread Thomas Gleixner
On Mon, 3 Jul 2017, Michal Hocko wrote: > On Fri 30-06-17 12:15:21, Thomas Gleixner wrote: > [...] > > Sure. Just to make you to mull over more stuff, find below the patch which > > moves all of this to use the cpuhotplug lock. > > > > Thanks, > > > > tglx > > > > 8< > >

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-03 Thread Michal Hocko
On Thu 29-06-17 18:11:15, Thomas Gleixner wrote: > Andrey reported a potential deadlock with the memory hotplug lock and the > cpu hotplug lock. > > The reason is that memory hotplug takes the memory hotplug lock and then > calls stop_machine() which calls get_online_cpus(). That's the reverse loc

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-03 Thread Michal Hocko
On Fri 30-06-17 12:15:21, Thomas Gleixner wrote: [...] > Sure. Just to make you to mull over more stuff, find below the patch which > moves all of this to use the cpuhotplug lock. > > Thanks, > > tglx > > 8< > Subject: mm/memory-hotplug: Use cpu hotplug lock > From: Tho

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-03 Thread Vladimir Davydov
On Thu, Jun 29, 2017 at 06:11:15PM +0200, Thomas Gleixner wrote: > Andrey reported a potential deadlock with the memory hotplug lock and the > cpu hotplug lock. > > The reason is that memory hotplug takes the memory hotplug lock and then > calls stop_machine() which calls get_online_cpus(). That's

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-06-30 Thread Andrey Ryabinin
On 06/30/2017 04:00 PM, Thomas Gleixner wrote: > On Fri, 30 Jun 2017, Andrey Ryabinin wrote: >> On 06/30/2017 01:15 PM, Thomas Gleixner wrote: >>> On Fri, 30 Jun 2017, Michal Hocko wrote: So I like this simplification a lot! Even if we can get rid of the stop_machine eventually this patch

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-06-30 Thread Thomas Gleixner
On Fri, 30 Jun 2017, Andrey Ryabinin wrote: > On 06/30/2017 01:15 PM, Thomas Gleixner wrote: > > On Fri, 30 Jun 2017, Michal Hocko wrote: > >> So I like this simplification a lot! Even if we can get rid of the > >> stop_machine eventually this patch would be an improvement. A short > >> comment on

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-06-30 Thread Andrey Ryabinin
On 06/30/2017 01:15 PM, Thomas Gleixner wrote: > On Fri, 30 Jun 2017, Michal Hocko wrote: >> So I like this simplification a lot! Even if we can get rid of the >> stop_machine eventually this patch would be an improvement. A short >> comment on why the per-cpu semaphore over the regular one is be

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-06-30 Thread Thomas Gleixner
On Fri, 30 Jun 2017, Michal Hocko wrote: > So I like this simplification a lot! Even if we can get rid of the > stop_machine eventually this patch would be an improvement. A short > comment on why the per-cpu semaphore over the regular one is better > would be nice. Yes, will add one. The main po

Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-06-30 Thread Michal Hocko
[CC Vladimir and Heiko who were touching this area lately] On Thu 29-06-17 18:11:15, Thomas Gleixner wrote: > Andrey reported a potential deadlock with the memory hotplug lock and the > cpu hotplug lock. > > The reason is that memory hotplug takes the memory hotplug lock and then > calls stop_mac

[PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-06-29 Thread Thomas Gleixner
Andrey reported a potential deadlock with the memory hotplug lock and the cpu hotplug lock. The reason is that memory hotplug takes the memory hotplug lock and then calls stop_machine() which calls get_online_cpus(). That's the reverse lock order to get_online_cpus(); get_online_mems(); in mm/slub