From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752379AbcLJE2C (ORCPT ); Fri, 9 Dec 2016 23:28:02 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44395 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751745AbcLJE2A (ORCPT ); Fri, 9 Dec 2016 23:28:00 -0500 Date: Fri, 9 Dec 2016 20:28:05 -0800 From: "Paul E. McKenney" To: Boqun Feng Cc: linux-kernel@vger.kernel.org, Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan Subject: Re: [RFC 0/5] rcu: Introduce leaf_node_for_each_mask_possible_cpu() and its friend Reply-To: paulmck@linux.vnet.ibm.com References: <20161209084828.11827-1-boqun.feng@gmail.com> <20161209234945.GM3924@linux.vnet.ibm.com> <20161210004538.GA9728@tardis.cn.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161210004538.GA9728@tardis.cn.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16121004-0008-0000-0000-0000064D087B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006224; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000196; SDB=6.00791781; UDB=6.00383607; IPR=6.00569527; BA=6.00004956; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013590; XFM=3.00000011; UTC=2016-12-10 04:27:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121004-0009-0000-0000-00003DBD58B3 Message-Id: <20161210042805.GN3924@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-10_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1612100057 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 10, 2016 at 08:45:38AM +0800, Boqun Feng wrote: > On Fri, Dec 09, 2016 at 03:49:45PM -0800, Paul E. McKenney wrote: > > On Fri, Dec 09, 2016 at 04:48:22PM +0800, Boqun Feng wrote: > > > Hi Paul, > > > > > > While reading the discussion at: > > > > > > https://marc.info/?l=linux-kernel&m=148044253400769 > > > > This discussion was for stalls specifically, rather than for routine > > scans of the bitmasks. > > > > But it does look to save some code, so worth looking into. > > > > > I figured we might use this fact to save some extra checks in RCU core code, > > > currently we iterate over all the possible CPUs on a leaf node, check whether > > > they were masked in a certain mask and do something. However, given the fact > > > that the masks on a leaf node should always be sparse than the corresponding > > > part of cpu_possible_mask, we'd better iterate over all bits in a mask and > > > check whether the corresponding CPU is possible or not. > > > > > > So I made this RFC, I did a simple build/boot/rcutorture test on my box with > > > SMP=4, nothing bad happens. Currently I'm waiting for the 0day and trying to > > > test this one a bigger system, in the meanwhile, looking forwards to any > > > comment and suggestion. > > > > > > So thoughts? > > > > By analogy with for_each_cpu() and for_each_possible_cpu(), the name > > should instead be for_each_leaf_node_cpu(), the tradition of excessively > > long names in RCU notwithstanding. ;-) > > > > Make sense ;-) > > I think it's more appropriate to call it for_each_leaf_node_mask_cpu(), > because we don't iterate all cpus of a leaf node. The word "possible" > could be dropped because obviously we won't iterate over "impossible" > cpus in a leaf node ;-) C'mon, Boqun! The for_each_leaf_node_cpu() is not only consistent with the for_each_cpu() family, it is shorter! ;-) Thanx, Paul > Will modify that in next version. > > Regards, > Boqun > > > Thanx, Paul > >