Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1245449rdb; Wed, 20 Sep 2023 04:04:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVnzGZGJKECXj6LyVi1dHyvqCTDd9difpBsZQ57C5E1yA7xoEByA1T49VL8LvZc/Jn+O+0 X-Received: by 2002:a05:6870:e0c8:b0:1bc:1651:10e with SMTP id a8-20020a056870e0c800b001bc1651010emr2205372oab.30.1695207892923; Wed, 20 Sep 2023 04:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695207892; cv=none; d=google.com; s=arc-20160816; b=fITSyx8Jakok31buuhrNMsDksnHzAgmsWxArHesTDlK3FgaCvgNxGLNv3Dsju4YHqB 28tPCS/wa0EjiMJAiJ9DZwSyzwRi/MU2auJZpaHFf1+oNA5GHfre7daGAmZQmbEC72Eb bJGJF8cZvsN2q+ZbcRc6gK8UC4RGwQy0rew6Im2osWifl/JlL2GZPsvv8kYusBpEgrE7 ZN6JrPMUs0OCn4jOXA1NRlF1JyqWeUwPe8+v35d4f+jRp0WTS72MeUfRQkYuXisrtgCF SSndnV/MzvZ0IOF0OuY8xQXqVn64lXuobiA+AwIFbmN2K8/WotuGHshbmY1/mpEKw9xT R4Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9R/oF8KtCbCn2jt5neND6B4IrCca60YWvFnhNkg9U7g=; fh=caD9FuttFWfNTiBDS1NX+TxHTc7uPs5M8y9CVBYrqec=; b=lEWZValZNacd3AAayTgwfZPSDSGoTYzriaIgdvy3f5wmAYEH+07BQXCwuEY8KjPjxC e2obll3drVOpF+1cTXZxu3bxtCVRB5Ww6p7dICkLFpVW2NmPRfnbcQ9/CRg1U/JmTz/Z mWYS820WKHykC3ob61hyyhqCNhVv/3IZu3Cg/dOcVAEJ1qUAEG7SK7YJttZTe9hd/hpt rnaki4ReIznbPoiqmgviwRQ+uHP7v3wkvBIpB7NnoE5i+X/vovUUKKC7b7/nswCh8Qyu ajHtoskyyU74zRIs83ONpnrfPDj4mEF1h82VI5KEe72tdwDFR/3uyQmbTuU1PqRu974Q yx3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pUYePQQD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h3-20020a636c03000000b00578b487825asi3029065pgc.208.2023.09.20.04.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 04:04:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pUYePQQD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3CEBB8296F0E; Wed, 20 Sep 2023 03:53:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234036AbjITKxS (ORCPT + 99 others); Wed, 20 Sep 2023 06:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233727AbjITKxR (ORCPT ); Wed, 20 Sep 2023 06:53:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CE52B4; Wed, 20 Sep 2023 03:53:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1096C433C8; Wed, 20 Sep 2023 10:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695207191; bh=h/O2jwYeAbLYLKbT6nnj9DrgguDTYSmof+htQUoyQkI=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=pUYePQQDGNByknxlRLr1DWklXKmeu5hup+NjPPbR4+rkvwNrxHpX9rZDUOyf+BQxe U/lMohSRUOiFPThvqtNTd/uJrbUGBshvQ5yuzRklUOskjiXZUU9IONjnHxZV+ZWYRb I+5C0jmwoTkzzagb8dULwCCJngZ2AP3UYnaOKGPWY0CEPhMiR+0jnroXVVhn6Bu+8J 1Du1AUFSkjIGwr1l0hrrF+UgwzxJ64gpdteFiUeKB4xM96NQCdPc975UG48pDHyOX5 G9z2V8MJOlcXzjQ5XshDkgzVeS/nSbUUEzzhs6SAgTwPanY9IWbb53y9956nXE48S8 K9jM0E4xz6VGA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B0453CE03D5; Wed, 20 Sep 2023 03:53:08 -0700 (PDT) Date: Wed, 20 Sep 2023 03:53:08 -0700 From: "Paul E. McKenney" To: Philipp Stanner Cc: Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rculist.h: docu: fix wrong function name Message-ID: Reply-To: paulmck@kernel.org References: <20230919194754.20574-2-pstanner@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230919194754.20574-2-pstanner@redhat.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 20 Sep 2023 03:53:20 -0700 (PDT) On Tue, Sep 19, 2023 at 09:47:55PM +0200, Philipp Stanner wrote: > The header contains a comment that details why the functions > list_empty_rcu() and list_first_entry_rcu() don't exist. It explains > that they don't exist because standard list_empty() can be used just as > well, but one can not expect sane results from a subsequent, quote, > "list_first_entry_rcu()". > > This function (obviously) does not exist. What the comment's author > actually meant was the standard list-function list_first_entry(). > > Change the function name in that comment from list_first_entry_rcu() to > list_first_entry(). > > Additionally, add the parenthesis to list_first_or_null_rcu to be congruent > with that entire comment's style. > > Signed-off-by: Philipp Stanner > --- > Hi! > I hope this helps. > I wasn't 100.000000% sure if that's correct, but I thought asking is for > free 8-) > > Regards, > P. Thank you for sending this! Please see below. Thanx, Paul > --- > include/linux/rculist.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/rculist.h b/include/linux/rculist.h > index d29740be4833..4837d8892691 100644 > --- a/include/linux/rculist.h > +++ b/include/linux/rculist.h > @@ -331,9 +331,9 @@ static inline void list_splice_tail_init_rcu(struct list_head *list, > * rcu_dereference() is not needed), which means that list_empty() can be > * used anywhere you would want to use list_empty_rcu(). Just don't > * expect anything useful to happen if you do a subsequent lockless > - * call to list_first_entry_rcu()!!! > + * call to list_first_entry()!!! You are quite correct that the original is incorrect, given that it does not exist, but a better change would be to list_entry_rcu(). The reason being that list_first_entry() does not have READ_ONCE(), allowing the compiler to play all sorts of games (see https://lwn.net/Articles/793253 for some examples). > * > - * See list_first_or_null_rcu for an alternative. > + * See list_first_or_null_rcu() for an alternative. Good catch! Please do feel free to send an update. Thanx, Paul > */ > > /** > -- > 2.41.0 >