Received: by 10.192.165.148 with SMTP id m20csp3919381imm; Mon, 30 Apr 2018 08:34:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3JtixPr780TLmnNdusTAKCfgtujNTBwKb4TJ8OKbX5ztdXBsUGCqmmFhU61Rjjpol9xtA X-Received: by 2002:a17:902:c81:: with SMTP id 1-v6mr12683327plt.126.1525102477108; Mon, 30 Apr 2018 08:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525102477; cv=none; d=google.com; s=arc-20160816; b=kyoyE+IYiMM+sFbjbn7v6wIgORTleypbTLo3+dJHsNCsEim3AvvFLDGa4gS6BTgsa5 LJYYMDcWjeWKf7EGXrwH3p4OFM/+gEAK3uySjwvw+Zav58qZL2KtEj8wQjvbkt0c8bef KpWzWxDg2Te1q2Tt3W1MlbIpvMBSjG+P+Z5KBYJ+UaafwK+w8axwOuN+FQxDRs0ZhWTh sh+azEnyeEBnRPy579WIifxfDLHTS3+/dPODsO/P/6do7vNfUaemBPIRfnvNZqNIFi+7 Cc8sQrrihltvk2Qih+/EUef5CCF4kf9R//ET3tZlvA+YmAIUdHN6bOKGQVqcvrP/GLWW vq8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=3cyp+DvCO69guLnWgGE9QvHB4OKuZMO4BqtPAwyJGwE=; b=Q9ypKk/cIGJ/zbQ9CDP9RITIfmhstnsX00TPBrLBBKml2odqbqlAURpzNRA1/mcFdo 531hXmmPcRx7R5Uu43YLc6P/g7zs1yKdfDieEohE1shlCry0FxfUMxG2Qwrond2ck/mv Yi6WA8gs0MPpABotNa2O/52z91xL9hEXLCfYOtEWgox8/X97ztLiP9nf1kS4jPmaRIDP /ap6ULr/D5WHlJkl9Lsdh0LfpEDS7H29UHf7WulRZDhOV+F/tvaV3A1vc70J6sH+w4Z4 9ShzT8YvcPDt6GTvQDRx8XYLYgw6mUGzJ+gi/vC1nRVcPi/FCCzetzl6BJJF8t5KTrJ7 Xn/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16-v6si7370429plp.487.2018.04.30.08.34.22; Mon, 30 Apr 2018 08:34:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754574AbeD3Pdz (ORCPT + 99 others); Mon, 30 Apr 2018 11:33:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36674 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753334AbeD3Pdx (ORCPT ); Mon, 30 Apr 2018 11:33:53 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3UFTVTi021245 for ; Mon, 30 Apr 2018 11:33:53 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hp3v4x6bn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Apr 2018 11:33:52 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Apr 2018 11:33:51 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 30 Apr 2018 11:33:47 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3UFXkiV51052720; Mon, 30 Apr 2018 15:33:46 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 83EC2B2054; Mon, 30 Apr 2018 12:35:47 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 4B273B204E; Mon, 30 Apr 2018 12:35:47 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E776116C0C3A; Mon, 30 Apr 2018 08:35:05 -0700 (PDT) Date: Mon, 30 Apr 2018 08:35:05 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Josh Triplett , NeilBrown , Trond Myklebust , Mathieu Desnoyers , Anna Schumaker , linux-nfs@vger.kernel.org, Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] rculist: add list_for_each_entry_from_rcu() Reply-To: paulmck@linux.vnet.ibm.com References: <152506256513.7246.13171564155614823841.stgit@noble> <152506269061.7246.13075216914692813995.stgit@noble> <20180430052032.GA16963@localhost> <20180430134308.GT26088@linux.vnet.ibm.com> <20180430111454.722c2aa8@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180430111454.722c2aa8@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18043015-0052-0000-0000-000002E6570D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008951; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01025507; UDB=6.00523683; IPR=6.00804738; MB=3.00020863; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-30 15:33:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18043015-0053-0000-0000-00005C8358B7 Message-Id: <20180430153505.GW26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-30_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804300148 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 30, 2018 at 11:14:54AM -0400, Steven Rostedt wrote: > On Mon, 30 Apr 2018 06:43:08 -0700 > "Paul E. McKenney" wrote: > > > On Sun, Apr 29, 2018 at 10:20:33PM -0700, Josh Triplett wrote: > > > On Mon, Apr 30, 2018 at 02:31:30PM +1000, NeilBrown wrote: > > > > list_for_each_entry_from_rcu() is an RCU version of > > > > list_for_each_entry_from(). It walks a linked list under rcu > > > > protection, from a given start point. > > > > > > > > It is similar to list_for_each_entry_continue_rcu() but starts *at* > > > > the given position rather than *after* it. > > > > > > > > Naturally, the start point must be known to be in the list. > > > > > > I'd suggest giving an explicit advisory comment to clarify and suggest > > > correct usage: > > > > > > "This would typically require either that you obtained the node from a > > > previous walk of the list in the same RCU read-side critical section, or > > > that you held some sort of non-RCU reference (such as a reference count) > > > to keep the node alive *and* in the list." > > > > > > (Feel free to wordsmith the exact wording, but something like that seems > > > like it would help people understand how to use this correctly, and make > > > it less likely that they'd use it incorrectly.) > > > > What Josh said! Could you also contrast this with the existing > > list_for_each_entry_continue_rcu() macro in the header comment as well > > as in the commit log? > > Should Documentation/RCU/whatisRCU.txt be updated? > > Specifically section: 7. FULL LIST OF RCU APIs Very much so, thank you for catching this! Thanx, Paul