From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8C09FA372C for ; Fri, 8 Nov 2019 20:26:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E59820869 for ; Fri, 8 Nov 2019 20:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573244803; bh=0g6wpz1ufWU/+noCtUaNqcZd3sQlCr9U0WbxteXS4Cw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=0F8Yo9ckYaToGPjvMVHoIw7R1PRRlX7nL8sWS6U0QnwnSkWHDdnn6nt84AsjAsxeH UNEC7JxyNyH5mFSCoYKKHDgZAkizIlVDrpRxoi6H+olc9y+C8AfkXpBeFOBBbgHVY5 YFjJKNHaPx3MmKUiI9ybG89GSTk5aoyQbfTPMwmo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729443AbfKHU0m (ORCPT ); Fri, 8 Nov 2019 15:26:42 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37350 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfKHU0m (ORCPT ); Fri, 8 Nov 2019 15:26:42 -0500 Received: by mail-lj1-f194.google.com with SMTP id l21so210729ljg.4 for ; Fri, 08 Nov 2019 12:26:39 -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=j0zhkdzedSyMQenwE3zFk80zLcJ6ug95TBUlVCOFQ8DKkeotGOQl1q02xt9PFY8frG usGcLoYBHRJaBNAhothN5NWziFrk8foQhj32EMDkNfVxwuhF2X4p4m4JM3h+6ZMin0UR SJAiUSpCAHOP2YxTlpYyPBVR6uS9fvH4GTF7Pqy5zxfNKT1YeBdDPq0nUNepwuYElUXM NHDzxJF75HUHigsGDSb7bBARaqax8dkZa/1kce/YR+UvHigUFszt/aqfl1qYBC4ivQSw tZYTyEgjtbtPy2MB04SkE8kfHcS08gUBDq/A2cmk8XYLWNO6zW3nsRjeg5r0iAsPHS2t pP0g== X-Gm-Message-State: APjAAAW4NytlFa/Sf2sCcmw67N4uXy7TV4KO7ZrEaM6UgPxgO4YAGvCT zbu7eouFtZbsCCCJwhWE+WtrZ/a1lMM= X-Google-Smtp-Source: APXvYqz2Waas81vsj2RF/TnX2uxj15s7V4q2MPL1rFFfzRGveOkLO6XfRfcSESvY0nqMNsW5dDMmRw== X-Received: by 2002:a05:651c:1ae:: with SMTP id c14mr7709772ljn.135.1573244798053; Fri, 08 Nov 2019 12:26:38 -0800 (PST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id a5sm2764853ljm.56.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-f180.google.com with SMTP id y23so7504432ljh.10 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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