Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4012798ybn; Fri, 27 Sep 2019 15:01:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2Wy/+7O02uwK+i/t4cQLYb+ZUleHIePmYMD77F1Utkb1BrtnxR/iBGv/DSTRMbKWHDVfr X-Received: by 2002:a50:9438:: with SMTP id p53mr7143349eda.291.1569621686556; Fri, 27 Sep 2019 15:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569621686; cv=none; d=google.com; s=arc-20160816; b=m2LvPvuFybuhPNXq+NZo2OLTHs8zYIiivWS2jkdQ6K5ub6XeuR58yAhRZpZ5D/J7Qk yHN65qXbIDtQnsmaqI5NcFAVPAYa7y1fC3yfdWVmxHLlBR2Ptj+NpRiiLzUoPuPflBmn FLpHQV7oPZI9auJLbXvmDuOuPKcGVOBmLg2SB5210BRK4FrOAJ3z1PHRbmuMHAapghkO 2tK+VohlWfLwZKH4+dOB9aky+8OS61OnwrD7oTwrJRt7jcAOSMmOdpNmakuMQNsq7COx F7AkHZ/oJ0d8UHnWsBNCcompXH3BmEmbN4+nCeOct5QWUqjKt/LI/VxWa7VPxz0TA6E6 yv9w== 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; bh=nuw8hxq0DylUDEW7q7+M1o9OUZzAvCdwyghW70aBjzo=; b=j0nYdUCg1CIs+GP3CHSbW3oqjO3/3x7UvyokakplNsnApF051v3vddFMH+RJB5CeAm FAbi2bAQY16NVGhgKdkymKtjk/I964lm9g1GvO2ez+dsdCjOrNldjls2hX1Hl/Oj6wPb s3B6l/rz8LIf97EuTq8pDmysWs5kHnnI3B2bUvBKTjzND7Xwh2SdP4ekTHLGpbnN6XB+ iYRBtE2IYfmIT31u6rZt/9zZRJBReChw3XvLJrT3e6CNNBIKSOrw3SD3x1b2WMOJBAh0 Ltx+wMZtyToOprEmiqZiZ889hffCcXDvWl1vr0VOuOAFGauN7fvw9HrEIjRFoSnGbYe0 paHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WmxTdKgI; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s42si2374959edm.292.2019.09.27.15.01.02; Fri, 27 Sep 2019 15:01:26 -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=@google.com header.s=20161025 header.b=WmxTdKgI; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727046AbfI0V61 (ORCPT + 99 others); Fri, 27 Sep 2019 17:58:27 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:34497 "EHLO mail-pg1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfI0V60 (ORCPT ); Fri, 27 Sep 2019 17:58:26 -0400 Received: by mail-pg1-f175.google.com with SMTP id y35so4179809pgl.1 for ; Fri, 27 Sep 2019 14:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nuw8hxq0DylUDEW7q7+M1o9OUZzAvCdwyghW70aBjzo=; b=WmxTdKgIVzQF3fQ443jwjpeN8KbSalfQE3hnCI238qadl1T+DDou6TS0m5gNEr5lyD +VZC1p9ILR0/SkXsMNR3fyoAhY36uPC95LhPq69S6AYdzVEJwBksNKpjnVWjgs2obYn8 XYk/CVjXgngaO2rWjmndT7q1p/MU++TaL07hsoTr+i+HTNuk3kzyVKNW6c8jDgREW5sz RYofgMNXzWppIOxdocfZQ4kqHqKufNcAeNDHNGC7ugK9OaLmK6pp3e3YJR5vYtPBVNm3 CTbNhobBRFK348USxiCX5UVnoJHH09E2HINsKPcicFyFuICJEnlhO1805qUltKC9/Wpu 2slA== 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=nuw8hxq0DylUDEW7q7+M1o9OUZzAvCdwyghW70aBjzo=; b=BE/EJM2bUq1t2Rlz6W7nJjhmrENBmApBUaPPOM5VYzL+1PZQ7IgHjcWeONPdaGyWNP Gvt9diSVnJQoX0T/lF7HB1XrREHfdfyehRkajoWQmXExAmDsksqQrEMR7TT4jtxyApL7 O1uqriQmWbJpjGu6a4OBiL6cQzIIy4NgteHvOsDqHvX263MKI0RMKhAYPBGO1CyM4gfC Yqehw6szdNCjkpBRUfdPlyTQe2w6PRoj4XGz0AV9D4xVIFLq6iQZnxtajhyeNMibheLn Q3Swk+cnLP+smH7v2JaVJY7GwE+QBEo6tZK4giGSOzX91mvW9OsrMQAHhH3swg1ICknz IGtw== X-Gm-Message-State: APjAAAWvUf6TzIDyYUYI+JmlQC0A3cKcGJAqHh6olGEYl/QuCvLahj/J ffru2BSoWpV/1vjeUo9/HujpOPX+TnT8fgSfSJBS7A== X-Received: by 2002:a17:90a:ff18:: with SMTP id ce24mr12342106pjb.123.1569621504669; Fri, 27 Sep 2019 14:58:24 -0700 (PDT) MIME-Version: 1.0 References: <20190915145905.hd5xkc7uzulqhtzr@willie-the-truck> <25289.1568379639@warthog.procyon.org.uk> <28447.1568728295@warthog.procyon.org.uk> <20190917170716.ud457wladfhhjd6h@willie-the-truck> <15228.1568821380@warthog.procyon.org.uk> <5385.1568901546@warthog.procyon.org.uk> <20190923144931.GC2369@hirez.programming.kicks-ass.net> <20190927095107.GA13098@andrea> <20190927124929.GB4643@worktop.programming.kicks-ass.net> In-Reply-To: From: Nick Desaulniers Date: Fri, 27 Sep 2019 14:58:13 -0700 Message-ID: Subject: Re: Do we need to correct barriering in circular-buffers.rst? To: Peter Zijlstra Cc: Andrea Parri , David Howells , Linus Torvalds , Will Deacon , "Paul E. McKenney" , Mark Rutland , Linux List Kernel Mailing , linux-fsdevel , jose.marchesi@oracle.com 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 Fri, Sep 27, 2019 at 1:43 PM Nick Desaulniers wrote: > > On Fri, Sep 27, 2019 at 5:49 AM Peter Zijlstra wrote: > > Barring LTO the above works for perf because of inter-translation-unit > > function calls, which imply a compiler barrier. > > > > Now, when the compiler inlines, it looses that sync point (and thereby > > subtlely changes semantics from the non-inline variant). I suspect LTO > > does the same and can cause subtle breakage through this transformation. > > Do you have a bug report or godbolt link for the above? I trust that > you're familiar enough with the issue to be able to quickly reproduce > it? These descriptions of problems are difficult for me to picture in > code or generated code, and when I try to read through > memory-barriers.txt my eyes start to glaze over (then something else > catches fire and I have to go put that out). Having a concise test > case I think would better illustrate potential issues with LTO that > we'd then be able to focus on trying to fix/support. > Further, if we identified a case were the existing invariants were broken under LTO, such a case could be added to CONFIG_DEBUG_LOCKING_API_SELFTESTS (or whatever the most appropriate kself test is). -- Thanks, ~Nick Desaulniers