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


Groups > linux.kernel > #1640689

Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest
Date 2017-05-12 21:00 +0200
Message-ID <tGnXb-lv-5@gated-at.bofh.it> (permalink)
References <tGmy5-7Uc-3@gated-at.bofh.it> <tGmy5-7Uc-1@gated-at.bofh.it> <tGnDQ-cz-19@gated-at.bofh.it> <tGnNv-gZ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, May 12, 2017 at 02:40:27PM -0400, Steven Rostedt wrote:
> On Fri, 12 May 2017 11:35:59 -0700
> "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On Fri, May 12, 2017 at 01:15:46PM -0400, Steven Rostedt wrote:
> > > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > > 
> > > Allow get_online_cpus() to be recursive. If a lock is taken while under
> > > "get_online_cpus()", it can call get_online_cpus() as well, just as long as
> > > it is never held without being under get_online_cpus(), but then calling it.
> > > 
> > >    GOC() -> Lock(X) -> GOC()
> > > 
> > > is OK, as long as
> > > 
> > >    Lock(X) -> GOC()
> > > 
> > > does not exist.
> > > 
> > > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>  
> > 
> > Does ->goc_depth also need to be initialized in include/linux/init_task.h?
> > 
> > It seems like C-language initialization-to-zero would cover this,
> > but there is a lot of initialization to zero values in init_task.h
> > (including but not limited to some RCU stuff).
> 
> I assumed that it would just initialize it to zero.
> 
> OK, I need to add this:
> 
> -- Steve
> 
> diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
> index fffe49f..be7f71b 100644
> --- a/include/linux/lockdep.h
> +++ b/include/linux/lockdep.h
> @@ -375,7 +375,7 @@ extern struct pin_cookie lock_pin_lock(struct lockdep_map *lock);
>  extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie);
>  extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie);
> 
> -# define INIT_LOCKDEP				.lockdep_recursion = 0, .lockdep_reclaim_gfp = 0,
> +# define INIT_LOCKDEP				.lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, .goc_depth = 0,
> 
>  #define lockdep_depth(tsk)	(debug_locks ? (tsk)->lockdep_depth : 0)

Or maybe we should remove a bunch of zero-initialization from that file.
But if it is needed, then that addition to the patch looks good to me.
Given how much zero-initialization there is, I suspect that it is needed
for some strange boot-up reason.  Hard to believe that someone would not
have gotten rid of it otherwise.

							Thanx, Paul

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest Steven Rostedt <rostedt@goodmis.org> - 2017-05-12 19:30 +0200
  Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-05-12 20:40 +0200
    Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest Steven Rostedt <rostedt@goodmis.org> - 2017-05-12 20:50 +0200
      Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-05-12 21:00 +0200
  Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest Thomas Gleixner <tglx@linutronix.de> - 2017-05-13 00:20 +0200
    Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest Steven Rostedt <rostedt@goodmis.org> - 2017-05-13 02:30 +0200

csiph-web