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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 476DDC3F68F for ; Thu, 6 Feb 2020 15:23:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0658222464 for ; Thu, 6 Feb 2020 15:23:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="WyAYDd36" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0658222464 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 86AD86B0003; Thu, 6 Feb 2020 10:23:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F4336B0006; Thu, 6 Feb 2020 10:23:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BC146B0007; Thu, 6 Feb 2020 10:23:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 50A5A6B0003 for ; Thu, 6 Feb 2020 10:23:35 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EDD5F824999B for ; Thu, 6 Feb 2020 15:23:34 +0000 (UTC) X-FDA: 76460071548.23.game82_5969854d89b1a X-HE-Tag: game82_5969854d89b1a X-Filterd-Recvd-Size: 3834 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Feb 2020 15:23:34 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id w15so5889472qkf.6 for ; Thu, 06 Feb 2020 07:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=frwRu00RMnlq6x7glE4bsBI/4vt4kjRzTWP+kvpkLb8=; b=WyAYDd36JnCVt8YDMm8NHzFSyiqKrVRAPtZwlDtSRhLLeDtmf4gNx4PWfg5Yf41GA6 r42deQ0bhRIemNw+5f24PcpodTWdbjDY3nHRTij+NdfNi33fOiErIe6klpPsvDEeUlDr aPQnBhJY+1GdLvQRVncUWkjtiDGilS/ebM08wNdW/wTqCo23x9vOoy06btD8KeCOT15A fRrVxGVqnPy1eUNi8dzpREXWWyQLrVVLx+pxLSdKL/tYjh2cI92R4NkvQcpPE5FbKZLW fIyVhlxF7YLYSXCJlbPPfVyN8bSvr72TAZosEfsLp2KG8i3sE6Tj939jUNMrHeIMBlfH 66FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=frwRu00RMnlq6x7glE4bsBI/4vt4kjRzTWP+kvpkLb8=; b=FXwTLzMmTOH/OAwsdLHk1cmvQVH8RoNofXEhDbiDhAcGpeDjTkhmOIAdDNb3885jKg hG+rVzTW7JmSTnbhfiR4R+SK6pG7EZfMsk153IEHXrlQlVm7LvQN9mFwIRY7XZ+uuTz3 yYCleemmeFD/e85aeEGMUvG+RfNU9vRIpWZrulkG4+qQjpm1T7YjbYe/83V7KmarHply fRgW2kd84vpSU1p/ODrxQPRvE+5jZSgPzlBjJb7r8I39bOvALlaDXPx/JYmOQDgN772i HOmwDHvMuR8p8f9YB+tmKlYwWoQF3zSn3pOKqCn0G63Ihcsh0kveO3QK1DwyRbMU3mLh a5Yg== X-Gm-Message-State: APjAAAVCeKomSPErcvk1f3Ws/nFEG/aZPACI/tlcqI8bXn37h1k3yaiR qCbo8jJyCHZfTam0M/SHA2HxHA== X-Google-Smtp-Source: APXvYqxODNY0lyU+d/2Mjfhf75XtA41+EuEtLTiEI7kRR25uJvxQ8Pfk9BIhCaWvay53pXiH1rh5RA== X-Received: by 2002:ae9:ed10:: with SMTP id c16mr2905732qkg.95.1581002613705; Thu, 06 Feb 2020 07:23:33 -0800 (PST) Received: from ?IPv6:2600:1000:b029:8fd0:fd1c:a898:e3b9:6ee8? ([2600:1000:b029:8fd0:fd1c:a898:e3b9:6ee8]) by smtp.gmail.com with ESMTPSA id 13sm1543881qke.85.2020.02.06.07.23.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 07:23:33 -0800 (PST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] mm: fix a data race in put_page() Date: Thu, 6 Feb 2020 10:23:31 -0500 Message-Id: References: <20200206145501.GD26114@quack2.suse.cz> Cc: David Hildenbrand , akpm@linux-foundation.org, jhubbard@nvidia.com, ira.weiny@intel.com, dan.j.williams@intel.com, elver@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org In-Reply-To: <20200206145501.GD26114@quack2.suse.cz> To: Jan Kara X-Mailer: iPhone Mail (17D50) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > On Feb 6, 2020, at 9:55 AM, Jan Kara wrote: >=20 > I don't think the problem is real. The question is how to make KCSAN happy= > in a way that doesn't silence other possibly useful things it can find and= > also which makes it most obvious to the reader what's going on... IMHO > using READ_ONCE() fulfills these targets nicely - it is free > performance-wise in this case, it silences the checker without impacting > other races on page->flags, its kind of obvious we don't want the load tor= n > in this case so it makes sense to the reader (although a comment may be > nice). Actually, use the data_race() macro there fulfilling the same purpose too, i= .e, silence the splat here but still keep searching for other races.=