Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3879711ybg; Fri, 25 Oct 2019 10:09:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsLa5GhYeEDM/az/VztGi9N1F7Qz9OxwZl1C9+NJtwHtpBY5bwzQ2BeO63cqr8oicq7e9w X-Received: by 2002:a17:906:22cc:: with SMTP id q12mr4616398eja.131.1572023374138; Fri, 25 Oct 2019 10:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572023374; cv=none; d=google.com; s=arc-20160816; b=oRsC6IJ693TxK6KHQ+Bg6UHJp6u/Br/S8bs7l1zhgAtHRSLttmyuIxSAw0BBxWizaJ Ur4DPVuRFNV3OUElYsz3nUS02wnTH6EWiMp51N2aJH1ja/qcqkR8mQebWo+mx3NHXmf4 2r8zsa95pTbvAn460wRROXUz9pePetluiDRP+obppPEKaSCZISP5iG0YtenfCp3XqLhJ mYO/FS72rxH5quhjiE5aLb9mcJAY51HV2S89HFQD2ajguuIqM2iM9G0HH10ODFc3i5e1 41VoUy84FE9mZ9lKjgvyCaebq0vla6g0QN6KbHBO6trb/Ny0c/TchgKpRyqy4zUgNKB4 XPQA== 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:dkim-signature; bh=HESF/d6OH5Aw6sJWEIGxgkKbyHNgcjcLHfFi7kk0g9A=; b=nAxxsg1MDkeFVgXneM+ht7ZE8i8vz+3peXEb5ydoc1pmLPhtsn6L5/C1mO+4IIgjUq lvWLHmTrDMkfTvvgrvEAeH6SNTmLivXu6mEXTgrs7x772gQnID0uOYrAW6yp8pyO8RuH txexxmlJEnoKkEzeJieQhJi4jtBh8lvKf4b2hlS7NO7+6lP2ZP9lh8MO00VNu0CaDePS ZzHHztKW3pPTw6h1b/IAdyID+cQ24J7btD6jynuSBU6q1Qc3qqqaS+fbYIcTyiyUNNPJ 9PFgz9wK2R3JAx1RVZokc7Yf0AIUMwWKA1h5KRMVHP5wYO6ZGTda+XmvukdjhCZyXBrT FnmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TcUTD+ag; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si1554453ejs.350.2019.10.25.10.09.05; Fri, 25 Oct 2019 10:09:34 -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=@gmail.com header.s=20161025 header.b=TcUTD+ag; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502860AbfJXOk7 (ORCPT + 99 others); Thu, 24 Oct 2019 10:40:59 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35077 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502826AbfJXOk7 (ORCPT ); Thu, 24 Oct 2019 10:40:59 -0400 Received: by mail-wr1-f67.google.com with SMTP id l10so25964785wrb.2; Thu, 24 Oct 2019 07:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HESF/d6OH5Aw6sJWEIGxgkKbyHNgcjcLHfFi7kk0g9A=; b=TcUTD+agNlBhc1hjm88GbLWqbU6tMfgjgHRDWLRNfaJ4hc36Tb9ML4aCHvpyxtPTEn C2E5Ewp7E6OTopg9A/Di347itIL2MdoqhpP4ZZjw5IJ7qLG0TzJvqUXDenxz7YMnEy6v l6zGfh6br2lRtFYR43Lk4U+bJoxH9+GT1LISiSL9zM1Np0ofboXkUMs6bZnwEWxybRw1 JdpELAxqwKgYbFXBggEFPWSTRbrhhmGFoyiyJzXAtLRf+WOyEqMFyKWvRlguOMPrD6TR QAOtAcx9am6QXkUKVLlsfd0JVcZbrIi83kS6v0lTep3b8TA80z8Fr9GHh52lINsSQT4V 8AfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HESF/d6OH5Aw6sJWEIGxgkKbyHNgcjcLHfFi7kk0g9A=; b=PkKkxQn5KHkzS11QS5PzOGTBpkSZH8hKJsr5chBxosfa8cbCZV6XIrEIdKHZqztUBo suuPXAE9+4/iLYUkYuGkK0wTuxVdPEHzYxwyDrvZXQtc/6R4/CXDTfMjZl24nC9FqpG/ 9/0H36I+wozOH/HCKtv0ww8bVQ38Pgy83QYecYage8CYHjZh13/dsbOeeZnFibkdsib9 MCsvTrbvvkkl/6eh8D2gx76EGX1Tb66y3H0cfaT1Jm1SkmQbijcPyiKPpTmhNtxeovF5 gbjn2kJ3hOmXuLkH/aDYKvSkVe8SpDagnwLLRmDGHonAe/kYYsfzqHTZKFZytpxO6Pwv i1PA== X-Gm-Message-State: APjAAAXSYKZF4ROBDHUMWoi84HAyzCx4gO1sIH4LfwzcvmkxRCcuo1Ej MGrCMEFFgNPp2F7AxurvLTs= X-Received: by 2002:adf:e381:: with SMTP id e1mr3927570wrm.94.1571928057005; Thu, 24 Oct 2019 07:40:57 -0700 (PDT) Received: from andrea.guest.corp.microsoft.com ([2a01:110:8012:1010:e187:86b0:69d4:5ba5]) by smtp.gmail.com with ESMTPSA id u1sm2289665wmc.38.2019.10.24.07.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 07:40:56 -0700 (PDT) Date: Thu, 24 Oct 2019 16:40:49 +0200 From: Andrea Parri To: Dmitry Vyukov Cc: Christian Brauner , Will Deacon , LKML , bsingharora@gmail.com, Marco Elver , stable , syzbot , syzkaller-bugs Subject: Re: [PATCH v6] taskstats: fix data-race Message-ID: <20191024144049.GA13747@andrea.guest.corp.microsoft.com> References: <20191009114809.8643-1-christian.brauner@ubuntu.com> <20191021113327.22365-1-christian.brauner@ubuntu.com> <20191023121603.GA16344@andrea.guest.corp.microsoft.com> <20191024113155.GA7406@andrea.guest.corp.microsoft.com> <20191024130502.GA11335@andrea.guest.corp.microsoft.com> <20191024134319.GA12693@andrea.guest.corp.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 24, 2019 at 03:58:40PM +0200, Dmitry Vyukov wrote: > On Thu, Oct 24, 2019 at 3:43 PM Andrea Parri wrote: > > > > > But why? I think kernel contains lots of such cases and it seems to be > > > officially documented by the LKMM: > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/memory-model/Documentation/explanation.txt > > > address dependencies and ppo > > > > Well, that same documentation also alerts about some of the pitfalls > > developers can incur while relying on dependencies. I'm sure you're > > more than aware of some of the debate surrounding these issues. > > I thought that LKMM is finally supposed to stop all these > centi-threads around subtle details of ordering. And not we finally > have it. And it says that using address-dependencies is legal. And you > are one of the authors. And now you are arguing here that we better > not use it :) Can we have some black/white yes/no for code correctness > reflected in LKMM please :) If we are banning address dependencies, > don't we need to fix all of rcu uses? Current limitations of the LKMM are listed in tools/memory-model/README (and I myself discussed a number of them at LPC recently); the relevant point here seems to be: 1. Compiler optimizations are not accurately modeled. Of course, the use of READ_ONCE() and WRITE_ONCE() limits the compiler's ability to optimize, but under some circumstances it is possible for the compiler to undermine the memory model. [...] Note that this limitation in turn limits LKMM's ability to accurately model address, control, and data dependencies. A less elegant, but hopefully more effective, way to phrase such point is maybe "feel free to rely on dependencies, but then do not blame the LKMM authors please". ;-) Thanks, Andrea