Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3812037imm; Tue, 29 May 2018 14:17:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLx0KbGXLShfKUYnHaw8DeK8/Ai/hPlqatP44k1sFVu4SmBd6Q8CyPSN7KUQ3prae6Th64v X-Received: by 2002:a65:420d:: with SMTP id c13-v6mr36604pgq.265.1527628660689; Tue, 29 May 2018 14:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527628660; cv=none; d=google.com; s=arc-20160816; b=zUB9YffrWun32v+51ZJLZR5NNL//x0N/3QSoV0qvS3KT0jr8n7s45QkkNMATpk+9bG zo0vUAdpOEhNbqInqWKSsYOwxvTZWQoG2wC8EBpiKgz5zdkgN9FoxGtq6qNJAdaVUy0q 0Re5zExT3FPSbP+v529v6xfsXUSl5Us3Hhkj29hOKSBuHne+BbLaOidun5GD1Ug28XqW X2evMpwzSMeEqgYumB8vcZ1WtfiLoaBFX8GsW7bfcirlbW6nBmCkTV3f3/F1iKckkJjj EbAHCsBnLb0WfCl3rzGpFebj2WvOCtNP6OxlR+bbw1COvm7QO5vDuSKsm9pLnNny+/JY Pvqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=e70SJevAUkLPMYiSHBqd+184NigYHVlFIH2iIth8n9I=; b=Cye/DRFxvV2r8XEAcvkzexrOv6qJZw/sPANuxKSMATU0Czd71Tc1pzbQgz4pBI0m5M xQ+OW+PkRE1f5sUmFJvpw0e5KBqVPCkL1zKjuymvgP2vlbrGc6JnPRrL3lQ8tIspVX+l AN11rzFuDrveCMA8OvcvEkxEGhW8ftpJDY9FoQ0Vg3i+c4dcxKncyKwpTOEEq1PO+KYr qejPySLuKBbeYOa1NwfY3obLL6LzVCdiBqXq7rZ1LyzE9z8L2GpHsYtrur5qGgzH4Lnz pNTubnNHyWcf04SADQ9pq3kcIGM4FhQ5sREJ6x++m1+MbIBvZ74F6n18XgxBy+nAjPNf tvoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HDfwbNuY; 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 i1-v6si25953375pgq.327.2018.05.29.14.17.26; Tue, 29 May 2018 14:17:40 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HDfwbNuY; 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 S966957AbeE2VQh (ORCPT + 99 others); Tue, 29 May 2018 17:16:37 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:46795 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966847AbeE2VQg (ORCPT ); Tue, 29 May 2018 17:16:36 -0400 Received: by mail-io0-f182.google.com with SMTP id d22-v6so4752762iof.13; Tue, 29 May 2018 14:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e70SJevAUkLPMYiSHBqd+184NigYHVlFIH2iIth8n9I=; b=HDfwbNuYUf5xWyKQtT3A+MFR64uAJa05PywB/4Juk0e6iF1yxEVUD5gmMZ6/GDyt7G 47b/dIFw8it/YmuqW4sBUmGij7tUhRsMOTC7da41tPaozcdB/k4Fg6lJYjnJtuaX8VWo g6y9KFv9tMdqxpVhfw/JH++evlVolGZizUBUE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e70SJevAUkLPMYiSHBqd+184NigYHVlFIH2iIth8n9I=; b=crZMj8Nomo8/aqq4ZFcgRrTjDlIm8+yGnB02XJrk/ryQb8tSKEqkAUtTWNZ32NqGlX NIHeetBRBxP24U4T1RPHf3DL5BUxTzT+ViUHXxu/gBEImDtPvuTGZB7IqoQUOpbsLstb jlsf5YhA9nO06nwldzENK52Wt1/5sOub0VdQVeKzIz+9MmBXYvXL6R7Ci3K68KTUAnbO frdKUEkfShMh3QMUjx2RUzySfDfdseTVD/gA+GKN17jOlrhlgYNaUWc22gExXYHes3TH 6BI+YnzmNhE6/gxG6KqGaLyNTC+7LdMAYRugmXtDNlwLo4OGtY//nddk0cIQy3BzT11o /lBA== X-Gm-Message-State: APt69E2GBDNtaYuVyTIEuD3BunwtgqXpBjx3eYQh71qcUcQZi1u5HDGT lGs+Mm8uO2bU+TpKz/shweWq0hdCsGHAyH5+bWY= X-Received: by 2002:a6b:f914:: with SMTP id j20-v6mr53837iog.238.1527628213105; Tue, 29 May 2018 14:10:13 -0700 (PDT) MIME-Version: 1.0 References: <20180529190332.GO3803@linux.vnet.ibm.com> In-Reply-To: From: Linus Torvalds Date: Tue, 29 May 2018 16:10:02 -0500 Message-ID: Subject: Re: LKMM litmus test for Roman Penyaev's rcu-rr To: Alan Stern Cc: Paul McKenney , Linux Kernel Mailing List , linux-arch , andrea.parri@amarulasolutions.com, Will Deacon , Peter Zijlstra , Boqun Feng , Nick Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Ingo Molnar , Roman Pen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 29, 2018 at 3:49 PM Alan Stern wrote: > Putting this into herd would be extremely difficult, if not impossible, > because it involves analyzing code that was not executed. Does it? Can't we simplify the whole sequence as basically A if (!B) D for that "not B" case, and just think about that. IOW, let's ignore the whole "not executed" code. If B depends on A like you state, then that already implies that the write in D cannot come before the read of A. You fundamentally cannot do a conditional write before the read that the write condition depends on. So *any* write after a conditional is dependent on the read. So the existence of C - whether it has a barrier or not - is entirely immaterial at run-time. Now, the *compiler* can use the whole existence of that memory barrier in C to determine whether it can re-order the write to D or not, of course, but that's a separate issue, and then the whole "code that isn't executed" is not the issue any more. The compiler obviously sees all code, whether executing or not. Or am I being stupid and missing something entirely? That's possible. Linus