Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7850625ybi; Thu, 6 Jun 2019 02:31:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGR7ro3fEe7FgAoSgisdXpSgwycmiPdxem9pc5t87FaXl1FUu7EhBGrVbzMr7PgOstgu+v X-Received: by 2002:a62:4dc5:: with SMTP id a188mr52808575pfb.8.1559813517325; Thu, 06 Jun 2019 02:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559813517; cv=none; d=google.com; s=arc-20160816; b=OMexI9kGkoowae+3oeeYr24AOOMX3FK/k8F7XWRv0bFYpLDseC1cQ9k/eN331KleTY JRqAHtz5Lw4CToqap03LplwdMi3FNbOAEFtpVrUbS3PkpyQ0D1+XKssLoF2HJkx6Lccd nsSgZPoodrTtGceR4mZIHf11MFA0Ifb5XxEe1xL8+49kN/6mzGmkkniqTCe2mITyIWNi UfqMc/BJIOV6lepwODe3KhfScxB8Wp/zDvu6qPngwdjXiED4P6akKzGDhSNBehb2bREm HCf5vtoKvS7PYy3w79cmOempqFGUbArC2AQGk5VDE8upyQna2TpJO+6tnbGruOC/tIu+ dMew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4sKYSyzsiEkb6zqwFW9TEq5zzoVG1HNwsHNI3VoSUpU=; b=kxr5si6ZMQYxxo5BJsI12z2J/Ggvq939aBAqQ1udd26O8CVI49/xq/IbqirBlOxX4E k2DLH6p4gv6yGfFvJC0TUD8Dy6Lg43eBvWP2MSZijd69DUbEimua6v5H+DYKKp23rHT8 I7iHGinRYRZZHhMPklPk4RPmlK+ah0e2/sBd3jhLIBf2VsKXMR71BXXhoN1vhIM7RHRb 6WvrF4JzDaUwMumK5ok5W4vn6FVaxJEmhezoQjvHr6RuQCR4S6FE5sO0ovUoHjWz4iyZ pZi0JnELwf4054i35A14Ncr/+HVErNRfU6MTsIEgMdRFHYXRlfd4q3AASJDR6LrO6SW+ S0GA== 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 q17si1812967pgl.27.2019.06.06.02.31.39; Thu, 06 Jun 2019 02:31:57 -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 S1727857AbfFFJ3N (ORCPT + 99 others); Thu, 6 Jun 2019 05:29:13 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:46636 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727833AbfFFJ3N (ORCPT ); Thu, 6 Jun 2019 05:29:13 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hYohm-0001wm-23; Thu, 06 Jun 2019 17:29:06 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hYohb-000735-8z; Thu, 06 Jun 2019 17:28:55 +0800 Date: Thu, 6 Jun 2019 17:28:55 +0800 From: Herbert Xu To: "Paul E. McKenney" Cc: Alan Stern , Boqun Feng , Linus Torvalds , Frederic Weisbecker , Fengguang Wu , LKP , LKML , Netdev , "David S. Miller" , Andrea Parri , Luc Maranget , Jade Alglave Subject: Re: rcu_read_lock lost its compiler barrier Message-ID: <20190606092855.dfeuvyk5lbvm4zbf@gondor.apana.org.au> References: <20190603200301.GM28207@linux.ibm.com> <20190606045109.zjfxxbkzq4wb64bj@gondor.apana.org.au> <20190606060511.GA28207@linux.ibm.com> <20190606061438.nyzaeppdbqjt3jbp@gondor.apana.org.au> <20190606090619.GC28207@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190606090619.GC28207@linux.ibm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 06, 2019 at 02:06:19AM -0700, Paul E. McKenney wrote: > > Or is your point instead that given the initial value of "a" being > zero and the value stored to "a" being one, there is no way that > any possible load and store tearing (your slicing and dicing) could > possibly mess up the test of the value loaded from "a"? Exactly. If you can dream up of a scenario where the compiler can get this wrong I'm all ears. > > But I do concede that in the general RCU case you must have the > > READ_ONCE/WRITE_ONCE calls for rcu_dereference/rcu_assign_pointer. > > OK, good that we are in agreement on this part, at least! ;-) Well only because we're allowing crazy compilers that can turn a simple word-aligned word assignment (a = b) into two stores. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt