Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Davidlohr Bueso
On Tue, 04 Jul 2017, Thomas Gleixner wrote: On Tue, 4 Jul 2017, Davidlohr Bueso wrote: On Tue, 04 Jul 2017, Davidlohr Bueso wrote: > As a side effect you end up optimizing get/put_online_mems() at the cost > of more overhead for the actual hotplug operation, which is rare and of less >

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Davidlohr Bueso
On Tue, 04 Jul 2017, Thomas Gleixner wrote: On Tue, 4 Jul 2017, Davidlohr Bueso wrote: On Tue, 04 Jul 2017, Davidlohr Bueso wrote: > As a side effect you end up optimizing get/put_online_mems() at the cost > of more overhead for the actual hotplug operation, which is rare and of less >

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Davidlohr Bueso wrote: > On Tue, 04 Jul 2017, Davidlohr Bueso wrote: > > > As a side effect you end up optimizing get/put_online_mems() at the cost > > of more overhead for the actual hotplug operation, which is rare and of less > > performance importance. > > So nm this, the

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Davidlohr Bueso wrote: > On Tue, 04 Jul 2017, Davidlohr Bueso wrote: > > > As a side effect you end up optimizing get/put_online_mems() at the cost > > of more overhead for the actual hotplug operation, which is rare and of less > > performance importance. > > So nm this, the

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Davidlohr Bueso
On Tue, 04 Jul 2017, Davidlohr Bueso wrote: As a side effect you end up optimizing get/put_online_mems() at the cost of more overhead for the actual hotplug operation, which is rare and of less performance importance. So nm this, the reader side actually gets _more_ expensive with pcpu-rwsems

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Davidlohr Bueso
On Tue, 04 Jul 2017, Davidlohr Bueso wrote: As a side effect you end up optimizing get/put_online_mems() at the cost of more overhead for the actual hotplug operation, which is rare and of less performance importance. So nm this, the reader side actually gets _more_ expensive with pcpu-rwsems

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Davidlohr Bueso
On Tue, 04 Jul 2017, 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 lock order to

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Davidlohr Bueso
On Tue, 04 Jul 2017, 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 lock order to

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Vlastimil Babka wrote: > On 07/04/2017 11:32 AM, 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

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Thomas Gleixner
On Tue, 4 Jul 2017, Vlastimil Babka wrote: > On 07/04/2017 11:32 AM, 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

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Vlastimil Babka
On 07/04/2017 11:32 AM, 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 lock

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Vlastimil Babka
On 07/04/2017 11:32 AM, 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 lock

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Michal Hocko
On Tue 04-07-17 11:32:34, 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

Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 Thread Michal Hocko
On Tue 04-07-17 11:32:34, 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

[patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 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

[patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem

2017-07-04 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