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


Groups > linux.kernel > #1680487 > unrolled thread

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

Started byMichal Hocko <mhocko@kernel.org>
First post2017-07-03 18:40 +0200
Last post2017-07-03 22:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem Michal Hocko <mhocko@kernel.org> - 2017-07-03 18:40 +0200
    Re: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem Thomas Gleixner <tglx@linutronix.de> - 2017-07-03 22:00 +0200

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

FromMichal Hocko <mhocko@kernel.org>
Date2017-07-03 18:40 +0200
SubjectRe: [PATCH] mm/memory-hotplug: Switch locking to a percpu rwsem
Message-ID<tZcyf-40A-41@gated-at.bofh.it>
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: Thomas Gleixner <tglx@linutronix.de>
> Date: Thu, 29 Jun 2017 16:30:00 +0200
> 
> Most place which take the memory hotplug lock take the cpu hotplug lock as
> well. Avoid the double locking and use the cpu hotplug lock for both.

Hmm, I am usually not a fan of locks conflating because it is then less
clear what the lock actually protects. Memory and cpu hotplugs should
be largely independent so I am not sure this patch simplify things a
lot. It is nice to see few lines go away but I am little bit worried
that we will enventually develop a separate locking again in future for
some weird memory hotplug usecases.
 
> Not-Yet-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[...]
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
[...]
> @@ -2138,7 +2114,7 @@ void __ref remove_memory(int nid, u64 st
>  
>  	try_offline_node(nid);
>  
> -	mem_hotplug_done();
> +	cpus_write_lock();

unlock you meant here, right?

-- 
Michal Hocko
SUSE Labs

[toc] | [next] | [standalone]


#1680555

FromThomas Gleixner <tglx@linutronix.de>
Date2017-07-03 22:00 +0200
Message-ID<tZfFM-6aZ-25@gated-at.bofh.it>
In reply to#1680487
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<--------------------
> > Subject: mm/memory-hotplug: Use cpu hotplug lock
> > From: Thomas Gleixner <tglx@linutronix.de>
> > Date: Thu, 29 Jun 2017 16:30:00 +0200
> > 
> > Most place which take the memory hotplug lock take the cpu hotplug lock as
> > well. Avoid the double locking and use the cpu hotplug lock for both.
> 
> Hmm, I am usually not a fan of locks conflating because it is then less
> clear what the lock actually protects. Memory and cpu hotplugs should
> be largely independent so I am not sure this patch simplify things a
> lot. It is nice to see few lines go away but I am little bit worried
> that we will enventually develop a separate locking again in future for
> some weird memory hotplug usecases.

Fair enough.

>  
> > Not-Yet-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> [...]
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> [...]
> > @@ -2138,7 +2114,7 @@ void __ref remove_memory(int nid, u64 st
> >  
> >  	try_offline_node(nid);
> >  
> > -	mem_hotplug_done();
> > +	cpus_write_lock();
> 
> unlock you meant here, right?

Doh, -ENOQUILTREFRESH

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web