Received: by 10.192.165.148 with SMTP id m20csp3803750imm; Mon, 30 Apr 2018 06:44:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrBJxPPWTI8tzj49kcPb1HQGgFHjpwHmXd85BYTqHQW9GJTdTmv1sRSeT6TxFRVVmSemZyx X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr8641948plo.357.1525095849550; Mon, 30 Apr 2018 06:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525095849; cv=none; d=google.com; s=arc-20160816; b=NMViNEbZoGOAto5fuubtzgrKtU2anmxSAKsqzmPlQbSWjh1P8wl97DTtd5uzeA3E2y tPG2RQwl3OosSfnlZknMEWAAKmmqNyHho5cwsj0z4iUUYdxAdkJN0CjlDKs87JIYgDoz 4Zx4ypPKhAhS2wJ5CCOv/GK1vHmT/H49oh3FwhT2QfQFPkxeaic3qIboBrss+CiOa9R4 P3DyxiYB2L+VMLRvOAHRb7wgVHYxUA/NqZrI/+14Lzcpk+onsI2zkw09Y3AJKj4h2D/t JRBVTeYg1MB5OJHNSkjuMqFpiPpU1q8a5vlp28cfB9NbcxHvx0fXy0EetTPyZy1LmYBx 1suw== 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=NUAxrPY83cV6SuNi0tDmlLxUY8yes9O/Y8uNRW4JuRs=; b=0bGCrztTrNHZsURALI5PmRmTMUr82Pegv6mdZGaNo5VD03XQRecXL0LibPh98lOb8B NZPxCteuq7Wwtm3YUQV6Ex52gB+24cXE2q9NiNuzS8vQoCOzH5UY28t/VutVwRKTK7Fe QsL3xqjVBpqKg3UzM2suVWIvxBaBWFNkhaZ6O9UyI1GXKdyxPIYM62L2J4H5YhoV3KrH wuzPkadpwSh8iUCui4qn5HiokgA9XbMNnUO0OJ/PtlZqFRYFJPNrVYvzsr5TJOWt58eI uERwFoGHvrHDQOIfh1s+5aJFQziOP5WGAwTrpjbhQPpAhUNBied87XNGZ2iubRvArhW8 zx9w== 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 24si7489647pfr.242.2018.04.30.06.43.55; Mon, 30 Apr 2018 06:44:09 -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 S1753890AbeD3Nl4 (ORCPT + 99 others); Mon, 30 Apr 2018 09:41:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54284 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751949AbeD3Nlz (ORCPT ); Mon, 30 Apr 2018 09:41:55 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3UDf8NH087775 for ; Mon, 30 Apr 2018 09:41:54 -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 2hp39sjufw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Apr 2018 09:41:53 -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 09:41:53 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) 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 09:41:50 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3UDfnAf46661878; Mon, 30 Apr 2018 13:41:49 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9AB79B2050; Mon, 30 Apr 2018 10:43:50 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 63278B2058; Mon, 30 Apr 2018 10:43:50 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E508616C0BFB; Mon, 30 Apr 2018 06:43:08 -0700 (PDT) Date: Mon, 30 Apr 2018 06:43:08 -0700 From: "Paul E. McKenney" To: Josh Triplett Cc: NeilBrown , Trond Myklebust , Mathieu Desnoyers , Anna Schumaker , linux-nfs@vger.kernel.org, Lai Jiangshan , Steven Rostedt , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180430052032.GA16963@localhost> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18043013-0052-0000-0000-000002E64C83 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008950; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01025469; UDB=6.00523662; IPR=6.00804700; MB=3.00020859; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-30 13:41:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18043013-0053-0000-0000-00005C831A19 Message-Id: <20180430134308.GT26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-30_05:,, 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-1804300132 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanx, Paul