Received: by 10.192.165.148 with SMTP id m20csp3900973imm; Mon, 30 Apr 2018 08:15:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo92imPwNnC1fyhhrdOq+qYgkkM/iVBbFmq62Zp9F+TdrBOPVSvRit2XXa9uHLZdoNI6xTg X-Received: by 2002:a63:3389:: with SMTP id z131-v6mr10384020pgz.386.1525101345479; Mon, 30 Apr 2018 08:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525101345; cv=none; d=google.com; s=arc-20160816; b=tiuZXUSRJhC8EEMzB20snLxdj4IbBs6yOYaUufUa6fN3EZjAfg95jCEzs+pI75pWUq KXo6o/yngmELfkRH0Quvs+V+ix2il5/YP8qa04tHy2zmrPJLhUQKJjPFQcy6aPLXQLk0 v9SPeONIO+swaZvlrmn9Y4nPBgv9HT2//lEtd1AKVuBuhRLA6wtDaDg7E9c/44+Il58f H8rCJOoIMx61gxCGuleZj6415bdS10t2hGvP2X/8hDA0CytvmWpvRQt8XrvGlZ3AEnm9 ADC/ODwDuPCP3D7bAHfXR0GZEUyqb56BUEYGaZ1vlZHbec9KchVNx8l0+VAslZw8T+hI wrIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=eMJ5NPj7WuPgbw2rzhiswQDxsnlAOzfS/bj49AdyRtE=; b=lT/aU20Ocw+qpVi44ZRuVXEvVf9QgaQ3tn1O/Z50DkyJThQI2z9NstdB3ZLpsjVHmJ WfEd1aJMdX4qMuA8WnY3oE6G/OJf43FfDQwLH2pDJNnEqI1LmXmOhB15JNKmptsMAgrN R7mH118oIMTIDx3HTmKJ8bcvBnmG3ny2uxdhF85OqHhzVWEFAgxUo/zu2r9SZ1noHbVv PdlX7bnyMpJICguPGfwfY8cQq4JgMg+b0B202tJXuJ7QeopfeUKhHQU6Laj68BVkQmhY LtT4xfMfHj7eoGst23Pn6O0BoVCsot2TnpQuc5c7gJd0C52IjkH+YpJbwc9a6NQLbxeq m3Pg== 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 z26si8116762pfl.209.2018.04.30.08.15.29; Mon, 30 Apr 2018 08:15:45 -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 S1754638AbeD3PPB (ORCPT + 99 others); Mon, 30 Apr 2018 11:15:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:37140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbeD3PO5 (ORCPT ); Mon, 30 Apr 2018 11:14:57 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9DA922C80; Mon, 30 Apr 2018 15:14:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9DA922C80 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Mon, 30 Apr 2018 11:14:54 -0400 From: Steven Rostedt To: "Paul E. McKenney" 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() Message-ID: <20180430111454.722c2aa8@gandalf.local.home> In-Reply-To: <20180430134308.GT26088@linux.vnet.ibm.com> References: <152506256513.7246.13171564155614823841.stgit@noble> <152506269061.7246.13075216914692813995.stgit@noble> <20180430052032.GA16963@localhost> <20180430134308.GT26088@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- Steve