From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE923C433FE for ; Thu, 10 Dec 2020 00:40:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2F4723CD4 for ; Thu, 10 Dec 2020 00:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729252AbgLJAkU (ORCPT ); Wed, 9 Dec 2020 19:40:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:58332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728477AbgLJAkD (ORCPT ); Wed, 9 Dec 2020 19:40:03 -0500 Date: Wed, 9 Dec 2020 16:39:22 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607560762; bh=9jkTkzNR5+yFLFpq3bVXs1VvccVU58KWQYAEI2PHgCU=; h=From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=QoOYmzZtFENS3dMnNiUr3cGsMcN8mmM9kCAuibYtxtQ7PKHck+m59wCEwRxKkVrrv QDX2QUSvqbF0fFzyQ6BrfERjslvxXfetI7UjydaKB6HzKGLRAiJxcBNhspbsxQqATj UQ4T2lRydrRmGQwNRu1uRBFK+/t+9fTyssvlkzDzrocScn6yquzQzXPBI1vQrxxV+8 bwtAYG98uAWEy/kkjBwx0HD3MfzlfzJt2SnRxqKO07DVgMzPaDaL+BxS5J9SDAigW6 /PTgr8DrHfpcbD+J7foIxQ8gV9NYVrsxUQdtRgx8ZvAo+qkvvTGDvRp7ZKDHcMGDeV ycusWKG2rNDVw== From: "Paul E. McKenney" To: Linus Torvalds Cc: Matthew Wilcox , Al Viro , "Eric W. Biederman" , Linux Kernel Mailing List , linux-fsdevel , Christian Brauner , Oleg Nesterov , Jann Horn Subject: Re: [PATCH] files: rcu free files_struct Message-ID: <20201210003922.GL2657@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <877dprvs8e.fsf@x220.int.ebiederm.org> <20201209040731.GK3579531@ZenIV.linux.org.uk> <877dprtxly.fsf@x220.int.ebiederm.org> <20201209142359.GN3579531@ZenIV.linux.org.uk> <87o8j2svnt.fsf_-_@x220.int.ebiederm.org> <20201209194938.GS7338@casper.infradead.org> <20201209225828.GR3579531@ZenIV.linux.org.uk> <20201209230755.GV7338@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 03:29:09PM -0800, Linus Torvalds wrote: > On Wed, Dec 9, 2020 at 3:07 PM Matthew Wilcox wrote: > > > > #. It is not necessary to use rcu_assign_pointer() when creating > > linked structures that are to be published via a single external > > - pointer. The RCU_INIT_POINTER() macro is provided for this task > > - and also for assigning ``NULL`` pointers at runtime. > > + pointer. The RCU_INIT_POINTER() macro is provided for this task. > > + It used to be more efficient to use RCU_INIT_POINTER() to store a > > + ``NULL`` pointer, but rcu_assign_pointer() now optimises for a constant > > + ``NULL`` pointer itself. > > I would just remove the historical note about "It used to be more > efficient ..". It's not really helpful. > > If somebody wants to dig into the history, it's there in git. > > Maybe the note could be part of the commit message for the comment > update, explaining that it used to be more efficient but no longer is. > Because commit messages are about the explanation for the change. > > But I don't feel it makes any sense in the source code. Like this, then? Thanx, Paul #. It is not necessary to use rcu_assign_pointer() when creating linked structures that are to be published via a single external - pointer. The RCU_INIT_POINTER() macro is provided for this task - and also for assigning ``NULL`` pointers at runtime. + pointer. The RCU_INIT_POINTER() macro is provided for this task.