Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9969979rwp; Thu, 20 Jul 2023 12:28:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+NDimVX4F+3n7NOXH+2pP8orS6YkmpWQRiiaHBa8A5II/X5O1VlYI24osCaGfRVcs9q1O X-Received: by 2002:a17:902:d345:b0:1b6:b445:36d4 with SMTP id l5-20020a170902d34500b001b6b44536d4mr344454plk.43.1689881327993; Thu, 20 Jul 2023 12:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689881327; cv=none; d=google.com; s=arc-20160816; b=Mz0fz5ZsywjG9HQPIy7bUceVa9lLFhz2zuNpqInm91vOjKAXkGGFugj8fuHfwtArly zaLb+qkkaXkO/ly2skLW7w8YCtVRXEm17VWa1Q2KfexMjRMBWgiAbWGd8sq5WmNkp/wv QeSoEOFayBG7iLPHAhvLst6QOH1nEz35PfxVVNLQdJ++dDHDDwOvgZzcVeSfmWljRtA1 GH/SwM6v65l6Qwm6zbpQzYknRhj8+JjlQjNsaQNEqiPwSaPeSTRCbqX9GOcymbYSr+ye KwWHCK06Dyp7LCKV88b5jmKzsd3Pyxv/92U5csLcBUcd5X8rHNZtOXbYyvh+1NJEsAba dBbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=IacBuQPmaTbg0zMPyJfZlxsv5lt3ViODtkIRDulzhHs=; fh=4ArxGi3pwy55pWwcUE5W0XzaD6HRE7l5wYElHSVZc/g=; b=CKcxOqvjMHe0KXE7UqLLGmTrmWnIxVEGLFitXvtzV692tKqYtxipY0/wCe5cpKxNN/ SHKd8ChgiZZk2CsD+93jSYCGowSBYRYQ6Zc/qxojLpZ/FebbknC4L16kJxwmqLW6rS/I ZP+lDzWje0JbQAaEfOeuzrkQTJRHAjJ3amFKcPosKEVImLvAVRyUDgAwxeieDc+n2FbA h3o6RI0rPlT6ZlOrexbfl2ko8VM8eVDHp7+ATJXNxrzCULQrlbgUUNgXvkjiSUWSRS8q GiW9+sCp//AhTYgV5FwV57swMqP4zouwEWsDhz0leH2i9EsNE1m6AL9G58MGA0/4T8PL TkCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="E/1t3ntk"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a17090301cf00b001b9d2659694si1577436plh.270.2023.07.20.12.28.35; Thu, 20 Jul 2023 12:28:47 -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=@google.com header.s=20221208 header.b="E/1t3ntk"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbjGTTWm (ORCPT + 99 others); Thu, 20 Jul 2023 15:22:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjGTTWk (ORCPT ); Thu, 20 Jul 2023 15:22:40 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C388D171D for ; Thu, 20 Jul 2023 12:22:39 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-401d1d967beso75941cf.0 for ; Thu, 20 Jul 2023 12:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689880959; x=1690485759; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IacBuQPmaTbg0zMPyJfZlxsv5lt3ViODtkIRDulzhHs=; b=E/1t3ntk/ROfOq0NxRVzaZGOQmS0fbflKbT5fuUtIrEPWVe0msQz4PFZdmoKFgoT+K 4hdX+Vr+qjYB/H18OSNxVOeX+fnRWnwnauDd01Wdvzy07Ih88dpkXC17UPwwt3Uajxg+ OOCiBtSo+KvcPWxuzYHJ2+D9XcSMuhwBLf0RYWW5lwMyzGZIDyfdxoDNA9fygY0yW4Ky oWbiHGY/k8ALT7xqHaZRqdYzMB49y9lH0cg5qejymAa01RK3tZpszbJvgZblNhFd9VdV 2/HdHxEKMGWwcg7BsBhlPoZKHTQc5W2hdO51RwBzDQJ6TOA7/+MNQu76+XIA+FMvOiVE tQLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689880959; x=1690485759; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IacBuQPmaTbg0zMPyJfZlxsv5lt3ViODtkIRDulzhHs=; b=N+Xl6/ceQTo2EThsqYjX3skp8TkMUe7C/PJGSXu73sZV5H2kybo6VM3GeCLTHVSBhD iWG5QCXoDOxohS6raTGJdTENcjXOVImJayfMVYOHrcoOXOisXJwdZalcmT7rFZxMDFLr u89Q5c5oDrKQd9JNHowS730nB4yn5GLLeY7X0Hh3NvmjWhSYDLm/6h2X3t/XZMXiDMTp FW/u3aPfSig0p/cF6sxHAFb80xiEPdDQ15LOBVlJUvGP3I9E4iwhMoY2E/Dg3a8PCfuW PpasH6X1fjrvixI43yyggXWvtF8FlAhJBdLKZ+aBaQWb14paBGBRF2A0rACRrubY9NxW ZjSA== X-Gm-Message-State: ABy/qLY7xW7orZU2IS08Igk4a8kZZ6/aPfnrqbbOK7e4PZQm+qpSCitj 9Fgf+Uu77x++lRnMkKhuMkfqQRdB15KGjf8qbN003Q== X-Received: by 2002:a05:622a:14c7:b0:3f8:5b2:aef0 with SMTP id u7-20020a05622a14c700b003f805b2aef0mr36407qtx.24.1689880958746; Thu, 20 Jul 2023 12:22:38 -0700 (PDT) MIME-Version: 1.0 References: <04C1E631-725C-47AD-9914-25D5CE04DFF4@gmail.com> In-Reply-To: <04C1E631-725C-47AD-9914-25D5CE04DFF4@gmail.com> From: Eric Dumazet Date: Thu, 20 Jul 2023 21:22:27 +0200 Message-ID: Subject: Re: Question about the barrier() in hlist_nulls_for_each_entry_rcu() To: Alan Huang Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, rcu@vger.kernel.org, "Paul E. McKenney" , roman.gushchin@linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Thu, Jul 20, 2023 at 8:54=E2=80=AFPM Alan Huang w= rote: > > Hi, > > I noticed a commit c87a124a5d5e(=E2=80=9Cnet: force a reload of first ite= m in hlist_nulls_for_each_entry_rcu=E2=80=9D) > and a related discussion [1]. > > After reading the whole discussion, it seems like that ptr->field was cac= hed by gcc even with the deprecated > ACCESS_ONCE(), so my question is: > > Is that a compiler bug? If so, has this bug been fixed today, ten= years later? > > What about READ_ONCE(ptr->field)? Make sure sparse is happy. Do you have a patch for review ? > > > [1] https://lore.kernel.org/all/1369699930.3301.494.camel@edumazet-glapto= p/ > > Thanks, > Alan