Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8605587rwp; Wed, 19 Jul 2023 12:20:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlEtLiUDzcRFutT1vVW7XYY5Rzjcvzpy+9MDs9iwjJ17q3KgN5i5BtPcF4VxtKOequUyWS8m X-Received: by 2002:a17:906:101c:b0:993:f996:52d3 with SMTP id 28-20020a170906101c00b00993f99652d3mr3023657ejm.25.1689794439850; Wed, 19 Jul 2023 12:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689794439; cv=none; d=google.com; s=arc-20160816; b=V0RoS+ZQY+CIQIQkHFARJhfkZzPKz+5LrrvmuV5iLdqRlb0Pfc2ndjIBgpax1D2ZlF alhy+ZB3FNDfkWtPEdSYF5IAgvFh/g5OKwfzRfIG0zWaoLl9QrbzJFRekroC29eVLLIw lgpJ3CgS561WLaAh4LfabrfOtEBxuvSNPUKtLy76NoW88eVhf8HiLsMSv/wIBZcYudHu OmTxXOKyBTqm3PnB+xpUKU2wOMwoB5MrDm3Glb2xQdf837Ou0PEGsqvAO/qyeDETpkIg O9haPfQkBSlEdK2EQUz4N7EHkPzdvb8K8iTYeqvIZLOdnmyJ8Z+AuUuL/ZFUCD6todSe v3uA== 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-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=LjIHu430gJNoRvIlTkDZtx/BTCgIkn4afOR2nbffuEE=; fh=LdvIw/dowbqg5nQk54YMNYEIXhbOpah7WPayTYO9Qho=; b=YyQrxj2h4y/iUMqkJchUw4f1XbHlVnJN0ni3zSTfKR+oMbYm0etnfGS8xhew8TLuYE tuDIM2pef1vQ/Ckvm+oUHH8oUDsrsa6BRjiY2C6kIx4Y1kz24HiHrylz1iUaQm0P8QGf NL3Q6+J2jNwzJqLC91jmRrv8BDJ/mKFC0IcMH7T9c423iUad1y9BFXnqL8jNkGMzgVWa PYJ0CVV9rTeSKlPflWRWq/YlAsSPWtPgrZg+HlWEf7EqFrW1tVPJ7+SIcuV/3qic2QtP n4JtBakXXogMP9+ZcJUtffLTcJaL7zJGSoa02o3L5iUqvvKG55tRu31k40RhrtNYDHep YK8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YP6THxhJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170906374600b00988796c2019si3147624ejc.591.2023.07.19.12.20.14; Wed, 19 Jul 2023 12:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YP6THxhJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbjGSSUn (ORCPT + 99 others); Wed, 19 Jul 2023 14:20:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjGSSUm (ORCPT ); Wed, 19 Jul 2023 14:20:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDEDDB6; Wed, 19 Jul 2023 11:20:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 533BC617DF; Wed, 19 Jul 2023 18:20:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9575C433C7; Wed, 19 Jul 2023 18:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689790836; bh=STDrO2XG5LQFsEtCL+3146/AIGbyOQu+kSYgcPpwbqE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=YP6THxhJrcWyOm88VDT+pQ6UdtyGZyURfg960GO72IfdKvfr863gwxG9KH7h0szw4 h8lc46JXX5FbCID14+MPczGiX98APiA+CQ4Pz/mrbHOXCaXhNhB47Nji6/g5rYMK7q mq/5fcYT4xrd+weSmhIdLFBmi2QBzHn+QDWtTMiLJQbgggj6x13kbbmqQyX84ZwjcY SZBCL9++rFHIckEUJZ1dqUACZ2rq3d2jS26/5Yz/FS/SungAO8Zy71OK0YqKCxRiZv JgaunElg6A2QjjfpkgkEDH9yzGHjC8lQOVayGiOHwUYWG6Yeh50A1oguN0Kmr7u8SM Jn5ivIXl/wXgA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 56910CE092F; Wed, 19 Jul 2023 11:20:36 -0700 (PDT) Date: Wed, 19 Jul 2023 11:20:36 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Alan Huang , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org Subject: Re: [PATCH rcu 6/6] rcu: Use WRITE_ONCE() for assignments to ->next for rculist_nulls Message-ID: <50bc6e0d-7d9b-4634-999a-2ee8f503e86a@paulmck-laptop> Reply-To: paulmck@kernel.org References: <6127192c-da9b-4599-9738-6e8f92e6c75c@paulmck-laptop> <20230717180317.1097590-6-paulmck@kernel.org> <9651c3b4-0791-5cd7-567f-f65d28bc8fae@joelfernandes.org> <3f6b04b3-af22-49f0-8d3c-269640f9f762@paulmck-laptop> <449d0d48-ac98-659b-4d03-e75c318605d4@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <449d0d48-ac98-659b-4d03-e75c318605d4@joelfernandes.org> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 18, 2023 at 09:48:59PM -0400, Joel Fernandes wrote: > > > On 7/18/23 14:32, Paul E. McKenney wrote: > > On Tue, Jul 18, 2023 at 10:48:07PM +0800, Alan Huang wrote: > > > > > > > 2023年7月18日 21:49,Joel Fernandes 写道: > > > > > > > > On 7/17/23 14:03, Paul E. McKenney wrote: > > > > > From: Alan Huang > > > > > When the objects managed by rculist_nulls are allocated with > > > > > SLAB_TYPESAFE_BY_RCU, old readers may still hold references to an object > > > > > even though it is just now being added, which means the modification of > > > > > ->next is visible to readers. This patch therefore uses WRITE_ONCE() > > > > > for assignments to ->next. > > > > > Signed-off-by: Alan Huang > > > > > Signed-off-by: Paul E. McKenney > > > > > > > > Did we ever conclude that the READ_ONCE() counterparts were not needed? ;-) > > > > > > Read-side is already protected by rcu_dereference_raw() in hlist_nulls_for_each_entry_{rcu, safe}. > > > > It turns out that different traversal synchronization designs want > > different pointers using WRITE_ONCE(). > > Thank you Alan and Paul, > > Btw, I don't see any users of hlist_nulls_unhashed_lockless(), maybe it can > be removed? Either that or the people who removed uses injected bugs... But if this one really does go away, do we need ->pprev to be protected by _ONCE()? Thanx, Paul