From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758916AbdELSw1 (ORCPT ); Fri, 12 May 2017 14:52:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56137 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756682AbdELSwZ (ORCPT ); Fri, 12 May 2017 14:52:25 -0400 Date: Fri, 12 May 2017 11:52:18 -0700 From: "Paul E. McKenney" To: Steven Rostedt 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 Reply-To: paulmck@linux.vnet.ibm.com References: <20170512171544.100715273@goodmis.org> <20170512172450.000006488@goodmis.org> <20170512183559.GA3956@linux.vnet.ibm.com> <20170512144027.77fde059@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170512144027.77fde059@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17051218-0036-0000-0000-000002044EB4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007051; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000211; SDB=6.00859626; UDB=6.00426129; IPR=6.00639210; BA=6.00005345; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015431; XFM=3.00000015; UTC=2017-05-12 18:52:21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051218-0037-0000-0000-000040507C94 Message-Id: <20170512185218.GD3956@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-12_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705120351 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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" 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) 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