Received: by 10.192.165.148 with SMTP id m20csp3413905imm; Sun, 29 Apr 2018 22:51:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpv7wC5Vg6Uz83lnUHs4ehwyvxDuQDG+B1PKwaaGEYWP7cvoQuhPm+SW7+zQAY2v96Te9Ak X-Received: by 10.98.180.2 with SMTP id h2mr10808264pfn.189.1525067509122; Sun, 29 Apr 2018 22:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525067509; cv=none; d=google.com; s=arc-20160816; b=dJAaXG2itS4B8p7J8r2I12UBK9e76SZwkRqIcMszx9Jt5oahpNzMJazPosYTx0DRCv aKv9j6E4antOLGjWAQHy+d9jHvNKbxJ4xCpsyLPqnrk+Fe/vu0Z1B61i4Pc7nwG1EcnI wWMdOiT8WdNaJ40kZvJYVZV22Li77NPi3J3F6mlwfHmZW6z3v83TU1qnR09xc5JT32Cb hBpEuW8yEh56AbNq+zhDN/qvDchUQ0n+qXWQnIkVgR7QNHsEEJpFNlQpbwbvTtKsWaFm BrM7b90IAJxSOggTRvoRnft7cYxL9tVYdgw0IjHAmA0fWgfsQRaN0P3x55oVvGwArUbT XVrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=U22aEbKYXOiyMaQ2YdWXFh65p0J4tfVtj+nCRYeHjs4=; b=TWHPicp6DSFRhoslebgBRbDS8YbGEC4IHB0O7udwhBsiix838RoPbfD/3gsmz2lTnd G3YXapC/UxvGauKS0sfAIhTR25YxGehp/6j/ixMjSrh8/DqHAiR5yRyLnYDMg2WujT9j dNaRaE3VzM3rpivC2L8H5cLWjal//bgemfBp0lHnmLnmHsdLDeKmnaNxxjU+/dMjp8H7 pB2PGfzVAmy1qevG5RB5k/mAK8aZ7C2cdbhlzClkEi4lFqItz1Cbz0iXl4cFtXKs+aWG VK//w/+zguTox9kbvHvyVGdQ7OEW3NlgwhmAJ8VKSqDhkoTNAJy9o0o1IG4WY+5LWkDK 0Yjw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i14-v6si5614168pgc.250.2018.04.29.22.51.35; Sun, 29 Apr 2018 22:51:49 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752103AbeD3Ftn (ORCPT + 99 others); Mon, 30 Apr 2018 01:49:43 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:35764 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752063AbeD3Ftl (ORCPT ); Mon, 30 Apr 2018 01:49:41 -0400 Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id EEA623A6550; Mon, 30 Apr 2018 07:20:43 +0200 (CEST) X-Originating-IP: 50.39.166.153 Received: from localhost (50-39-166-153.bvtn.or.frontiernet.net [50.39.166.153]) (Authenticated sender: josh@joshtriplett.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id A962CC0005; Mon, 30 Apr 2018 07:20:39 +0200 (CEST) Date: Sun, 29 Apr 2018 22:20:33 -0700 From: Josh Triplett To: NeilBrown Cc: "Paul E. McKenney" , 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() Message-ID: <20180430052032.GA16963@localhost> References: <152506256513.7246.13171564155614823841.stgit@noble> <152506269061.7246.13075216914692813995.stgit@noble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152506269061.7246.13075216914692813995.stgit@noble> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Level: 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 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.)