From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758781AbdELSkb (ORCPT ); Fri, 12 May 2017 14:40:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796AbdELSka (ORCPT ); Fri, 12 May 2017 14:40:30 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAA6623986 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 12 May 2017 14:40:27 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Mathieu Desnoyers , Masami Hiramatsu Subject: Re: [RFC][PATCH 2/5] cpu-hotplug: Allow get_online_cpus() to nest Message-ID: <20170512144027.77fde059@gandalf.local.home> In-Reply-To: <20170512183559.GA3956@linux.vnet.ibm.com> References: <20170512171544.100715273@goodmis.org> <20170512172450.000006488@goodmis.org> <20170512183559.GA3956@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 May 2017 11:35:59 -0700 "Paul E. McKenney" wrote: > On Fri, May 12, 2017 at 01:15:46PM -0400, Steven Rostedt wrote: > > From: "Steven Rostedt (VMware)" > > > > 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) > > 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)