Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2999326ybx; Fri, 8 Nov 2019 12:29:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxk7qMtp7kiYJHO1wcjpDtY8RyEFa5fDkqVXTmoIG+CLtR4rBiYDvzSBHxuc0iFt+q5M5H9 X-Received: by 2002:a50:b2c4:: with SMTP id p62mr12387389edd.128.1573244987858; Fri, 08 Nov 2019 12:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573244987; cv=none; d=google.com; s=arc-20160816; b=V+c691qwX3B5J3FC2fBSGe717VJgU2p9Nr5VrIMZXyZ8JuxjynyDDxzNbDlSWVI85d /LxjAO+EGO6QiQUY0Hch8w8P7BJUU1L7Z80KP7sK2GtNe0R8qN38ogk9XJ8sftdas8mu 9CHubn4euU2e6KCVEKLhGpNx9Zj0+fIf+5KoQdKO7glfKIzMiLj0Go1Doaz0uprK54Wq OuR6w0dzFk1Fx3wOuSsiqCtw2VjMGhna1Xl6Ay30BlzfLCf/nJvn1ZtsrCRfeqN4O+ZO 7pi75R/xiTBEwYQF4WWKRqCS6Hgj+552qi5B9/JiWLv1tWk2QHwY44TljrcmY7OtcEiB dQcg== 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=yMlK7Upw2ce5Zg7xMf34DmhBHJDspfQIGQ9pArSi7bQ=; b=KwhKEnoNQ3VzbPTbb6mFEFa3QAR7yiMofIFlAck7+OY0/wAYupBdQ9g3k5g9YpkseK 13FdWVCjDZIbirvTVFMHjCCjy6E1llzDOnrMSV6pAGnWnp+5M+9b2ywhPeBfob2Fpxeb X1A7Ow0yoJsG0L/MriqrdCbW2ru/CrCds+BxG6lTScjyv2vFgZwY453mPWHNF8100a/Q n5U3Z7TnuRt9a07bNEcQDCX7DGf+AlXDPpVIqeXdrMMHZagQmJ6USFYMUlK1e78lUiTP VSQ5iIggqEgHX3mYN0Uh7GwRfBkQ29TzEQ5YT1cVr0x1RgSxAxEebAOwtGUBKgP1/sPd rdbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ewzwuNQJ; 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 f4si4405161ejc.218.2019.11.08.12.29.24; Fri, 08 Nov 2019 12:29:47 -0800 (PST) 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=ewzwuNQJ; 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 S1728714AbfKHU0j (ORCPT + 99 others); Fri, 8 Nov 2019 15:26:39 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46132 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfKHU0j (ORCPT ); Fri, 8 Nov 2019 15:26:39 -0500 Received: by mail-lf1-f65.google.com with SMTP id o65so1741286lff.13 for ; Fri, 08 Nov 2019 12:26:38 -0800 (PST) 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=yMlK7Upw2ce5Zg7xMf34DmhBHJDspfQIGQ9pArSi7bQ=; b=ewzwuNQJNv+rrAILk6q5QHFnd1Xzbim9h9jPAvXpQWCTVqKUJmJw++ZuvJ2MYk9fCx czzZhfUQJ6541scoc2zP5x8caPV4R3FzvKOXqehc3zRMpi+NGAJACZ9aWVponq/2HLdq roQhq+s37Hg01PjIBwDBF0Zc6qNUt1DhxJssk= 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=yMlK7Upw2ce5Zg7xMf34DmhBHJDspfQIGQ9pArSi7bQ=; b=m4xsem/0FehgYVsWpRIWemm+GndUVfl2zaghcyfJk+RAlwP0kIYUwSGcNf+GaCrsOO /+WOBhhzI8xPIeZP5k3wLVYu649gZHomGblGkbZPGvCL2d9AXwcnb7/R11DZSuAICmvx W59Ei73pM97eRtgljbhylkT/ItQiVWuLsaFk7Efe4V1f06yVK5WSo0SxgduUNL+Rc7DE PIrPjdkFOo+sVjHU5eXwRoGHHL/EyBtscfWpzVs6jnM5grDHaNZHs9fmrpHtJnO6ENzG K1h70IahHhKk6FazaDZ71g/7wAy2NYadrzlHDZtS+fnjTs9lPrYdlnMCfnNSljRgEcd4 TRjQ== X-Gm-Message-State: APjAAAU51MO/MkdiIv4uokTYa5teHkqdUQPrgDjJ1qAMzWd9KdfEnhOP IwfNOwHGVfSHZYrHO4hIYsXgXEa+P+w= X-Received: by 2002:a19:e018:: with SMTP id x24mr7750151lfg.191.1573244796537; Fri, 08 Nov 2019 12:26:36 -0800 (PST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id u14sm3048921lfk.47.2019.11.08.12.26.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 12:26:35 -0800 (PST) Received: by mail-lj1-f171.google.com with SMTP id n5so7529549ljc.9 for ; Fri, 08 Nov 2019 12:26:35 -0800 (PST) X-Received: by 2002:a2e:9a8f:: with SMTP id p15mr7938802lji.148.1573244794852; Fri, 08 Nov 2019 12:26:34 -0800 (PST) MIME-Version: 1.0 References: <000000000000c422a80596d595ee@google.com> <6bddae34-93df-6820-0390-ac18dcbf0927@gmail.com> In-Reply-To: From: Linus Torvalds Date: Fri, 8 Nov 2019 12:26:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: KCSAN: data-race in __alloc_file / __alloc_file To: Marco Elver Cc: Eric Dumazet , Eric Dumazet , syzbot , linux-fsdevel , Linux Kernel Mailing List , syzkaller-bugs , Al Viro , Alan Stern , Andrea Parri , "Paul E. McKenney" , LKMM Maintainers -- Akira Yokosawa 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, Nov 8, 2019 at 11:48 AM Marco Elver wrote: > > It's not explicitly aware of initialization or release. We rely on > compiler instrumentation for all memory accesses; KCSAN then sets up > "watchpoints" for sampled memory accesses, delaying execution, and > checking if a concurrent access is observed. Ok. > This same approach could be used to ignore "idempotent writes" where > we would otherwise report a data race; i.e. if there was a concurrent > write, but the data value did not change, do not report the race. I'm > happy to add this feature if this should always be ignored. Hmm. I don't think it's valid in general, but it might be useful enough in practice, at least as an option to lower the false positives. Linus