Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp160952rwb; Fri, 4 Aug 2023 10:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3RYjhkeMifCzWbChxeqACGtGz5fqXM1A5UMzwbN5LtOuxvju8F0/yoK/A1RGaMoTkpuy1 X-Received: by 2002:a05:6a21:6da9:b0:134:16a3:82f9 with SMTP id wl41-20020a056a216da900b0013416a382f9mr2583254pzb.55.1691170511928; Fri, 04 Aug 2023 10:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691170511; cv=none; d=google.com; s=arc-20160816; b=wMaoKy5CvSjMj+YxKdyuaAaqs2rJmvpcykTjuycopHxYelrizrF3Hg78IzBsTW27WN u8y/O4kwT9oiwTNLIxtqmOJUS3FYhebsHr4IZBlC9Dd329C0ai/avXNIGFJeHgFHUXlk ro849Ff4aze7Pzf2+wYcEt/jOVxdBaAk67ikm9Q0K8Qgy6EFol+15aCQdGSRxJAxcJXe /AqvhtV4nMc4QFUP8BJzX+jfonDo5ZzmOMYxH6G/n/nM78mn6J4NCvqrKUVCvzDiRXKU 7juQs7DqUh3xnvdK3pVaA3iAQiWSk1WaqWUHt/4+lTt+Wo7yhtTFBMvoq3YhkB+J1PzO 3h+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OczlVn14irTWoDlxC+z8REFyp0aBePT2F2CzHZGwXHY=; fh=omiSUxy9Datczg45V6AQq8cKprcKaXXinxEC+SL0KoU=; b=AzAaeVrbDqTkB+Sd/9PMCNKCL+uXRbgrIQoA97V8ERlQN6dadjZ+H8kLSzhExTFarL m0LKYhAOgMiyLqUVAOpruYO/M3uHMTRuajOQCNUGrAdi9pAubz3Zrmav1RR3gW+qyRYi LYtPgAuFi//BU3vLMiqzOVSid081/usG5rGYpPBALGVRPnmbG5kyxs7Fis5pJVkINMMl BBdPcCMBkIy8LoZo6udOiLV7yFJ0e/MD0aTmTdxxcUEEIzs1xmb/7JU+Ck7UISB5EZiE HbRHc1g159tM8A2fASZm7CGo/Ej7m+6JXiZHi0mHilAx+hRC/cWFm7OO5FwbefxZOlgJ 73FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=RkqWEyJE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020a6567da000000b005649974da2bsi1307848pgs.526.2023.08.04.10.34.58; Fri, 04 Aug 2023 10:35:11 -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=@joelfernandes.org header.s=google header.b=RkqWEyJE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjHDQSQ (ORCPT + 99 others); Fri, 4 Aug 2023 12:18:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbjHDQSO (ORCPT ); Fri, 4 Aug 2023 12:18:14 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634E92D71 for ; Fri, 4 Aug 2023 09:18:11 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b9f48b6796so35233111fa.3 for ; Fri, 04 Aug 2023 09:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1691165889; x=1691770689; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OczlVn14irTWoDlxC+z8REFyp0aBePT2F2CzHZGwXHY=; b=RkqWEyJE4NqJikRdb1bt+JO7LGnVKha31RC4IVbIPIO5UDriOK5EaQZu47hf3Iq1RJ Dep+Jc1WWJU4IWnGHY16tTzDNoUHnuWQQ8+b/gqB0FxnB2qSa4b7PB0v8QxccmDQbQBC g5+MxPkXGouVVQuOkMCuyAnLYg0t7pvjis8tA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691165889; x=1691770689; h=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=OczlVn14irTWoDlxC+z8REFyp0aBePT2F2CzHZGwXHY=; b=BEvjAB5aq9vc9L4oNpaTJEBEnM9xpuACvsWtVj7nYUWr/2WOZxw/Ny4gWGGD2gH2oh 7APcj05tKrLqMIS+WCi+zuGQs2tKky+cyFEnGlFfoeBi21nQ0i/OIFdUURDWy+cVPdZ2 cCCBlBEy1UXamqLkU1KvzkMBt1y5sQc8uMWsKhy5xOuWWXpwxD0uRGr+esizQ6DmjHAe vxd+cXCYxp6lKxuTAaOF6oStLMyqCky1H5OoNe557XDC5pVp1/mhERHaieEqbsVms6U0 Rvzk/wE5AHD+Zinb68mCWD+wDxxygB1qU6pVXnNyDIYbeomosAGPjwmgZJb+u4L7r1fi snAA== X-Gm-Message-State: AOJu0YyObdghcbGO3o19rQ1/woh/g9g1+UERZCPnDtWtIhkgPqvrfpjP sII7Yq0ss5V3Unm8PpUZMMw7sxeGgY1e7wJuwebEsA== X-Received: by 2002:a2e:a442:0:b0:2b8:3a95:38b5 with SMTP id v2-20020a2ea442000000b002b83a9538b5mr1789304ljn.50.1691165889424; Fri, 04 Aug 2023 09:18:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joel Fernandes Date: Fri, 4 Aug 2023 12:17:58 -0400 Message-ID: Subject: Re: [PATCH 1/2] docs: rcu: Add cautionary note on plain-accesses to requirements To: paulmck@kernel.org Cc: Alan Huang , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, Will Deacon , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Jonathan Corbet Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 [...] > > >> However, the kernel consider the volatile access to be atomic, right? > > > > > > The compiler must therefore act as if a volatile access to an aligned > > > machine-word size location is atomic. To see this, consider accesses > > > to memory that is shared by a device driver and that device's firmware, > > > both of which are written in either C or C++. > > > > Btw it appears TSAN complaints bitterly on even volatile 4 byte data races. > > Hence we have to explicitly use atomic API for data race accesses in Chrome. > > That might have been a conscious and deliberate choice on the part of > the TSAN guys. Volatile does not imply any ordering in the standard > (other than the compiler avoiding emitting volatile operations out of > order), but some compilers did emit memory-barrier instructions for > volatile accesses. Which resulted in a lot of problems when such code > found compilers that did not cause the CPU to order volatile operations. > > So a lot of people decided to thrown the volatile baby out with the > unordered bathwather. ;-) Thanks for the input, I think TSAN was indeed worried about memory-ordering even if relaxed ordering was intended. I think there is a way to tell TSAN to shut-up in such situations but in my last Chrome sprint, I just used the atomic API with relaxed ordering and called it a day. :-) - Joel