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, 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 92C65C352A3 for ; Tue, 11 Feb 2020 17:33:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 55B07208C3 for ; Tue, 11 Feb 2020 17:33:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="iaGRCVP/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55B07208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F2AB36B0302; Tue, 11 Feb 2020 12:33:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EB3E46B0303; Tue, 11 Feb 2020 12:33:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA2656B0304; Tue, 11 Feb 2020 12:33:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id BFF286B0302 for ; Tue, 11 Feb 2020 12:33:37 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5CDDF2496 for ; Tue, 11 Feb 2020 17:33:37 +0000 (UTC) X-FDA: 76478543274.05.grade20_3c9b3c7de0761 X-HE-Tag: grade20_3c9b3c7de0761 X-Filterd-Recvd-Size: 4505 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Feb 2020 17:33:36 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id r19so12570451ljg.3 for ; Tue, 11 Feb 2020 09:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mhU8f3tYJtrk38FbIQtQIUR9krI8Xmf5E+ayMa/npVQ=; b=iaGRCVP/LYeyxdvt2emNVVBd/cohw9foeWAflNA7mi7qm+FAKZ03xzfSC/sXIPHjQX ZOI9bjqMZHf3pZRIDkd7I6s59nPmADbD9gVQGcpvrnXGc0gVEnmVobyR/1OVzRUzBUvg 1fbSkpqndKiXF5JfAuJscxHr2Ghjn+L5O6lTtZYJVxwZehHvDUNqawHsNmwXjtWw11QD 4JfbwTq2qpcWyKBpinCmQ80a5HGFjwadtXow7IbRTBv/REOTCpCxyg7oWpAgPUXwrzvr DMI0Wop8tv9wIK8uBF9mwmsZGoQWNd0kXpkRXdcbwh2ixHHW9CDZSvZW30n9cRFd+sCq o35A== 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; bh=mhU8f3tYJtrk38FbIQtQIUR9krI8Xmf5E+ayMa/npVQ=; b=i8F3nKqSUc5gPGTvCW/pU3XTpuzj0RuDuk0GqhHbYPdgRFHhvrJXX9uy8W128/uccM ZHVSBT+HscAkV8FVB7XXnJ1i9fpcA39d4FE6hx2ke6dOHsfmWc/yI7csyNTFHhaUkwgH CDp19Kt5nfCnP8iQ0kr/4b1n1wYaTL4hm3+PLk+esHNjwtjZfT2bfkAN1CAMAlTdl/O7 CBO3EpsrtzKWXMzpCoGmym5xtQN9a8Y5MDSaJ6n2fbYRz2cnXXTIEKDiOTgALfLoPc84 BktSNS0M6jhrF97M8J2c3TJJqNSuanx3Qv8NaLEB9teBmQd0hAR3IPybSLP4eMo9ggG8 kX/Q== X-Gm-Message-State: APjAAAVY8Qdfq4Qzd/UijHadRvdci5T13qWSQFyVdtETfjsbEG/6185F RgvHxWsQbgDatZWHwORlbuiGyg== X-Google-Smtp-Source: APXvYqzfEoCHsBl1Bq6gGLey1p87G6O0nlSWakue/hJLv0l6IWAzOXFN4P0aorpMmtCOEPgLLsMK1A== X-Received: by 2002:a2e:556:: with SMTP id 83mr4866873ljf.127.1581442414864; Tue, 11 Feb 2020 09:33:34 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id l7sm2107960lfc.80.2020.02.11.09.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 09:33:33 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id DC2E3100983; Tue, 11 Feb 2020 20:33:52 +0300 (+03) Date: Tue, 11 Feb 2020 20:33:52 +0300 From: "Kirill A. Shutemov" To: Jeff Moyer Cc: Justin He , Catalin Marinas , "Kirill A.Shutemov" , "linux-mm@kvack.org" Subject: Re: bug: data corruption introduced by commit 83d116c53058 ("mm: fix double page fault on arm64 if PTE_AF is cleared") Message-ID: <20200211173352.wjm6govzcqy355y7@box> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000077, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 11, 2020 at 11:44:06AM -0500, Jeff Moyer wrote: > Hi, Justin, > > Justin He writes: > >> Thanks for the report. But this commit 83d116c53058 doesn't add the > >> new clear_page code path. Besides the pte_mkyoung part, It just refines > >> the codes(no functional change) and add a WARN_ON_ONCE to indicate > >> there is any obscure case before. > > > > I can't reproduce it with your provided test file on my arm64 qemu with > > a pmem device. > > Could you do me a favor that just revert 83d116c53058 but keep that > > WARN_ON_ONCE after clear_page()? Is there any difference? > > Thanks for your help > > Below is the patch I used to put the WARN_ON_ONCE after the clear_page, > just to be sure that's what you intended. So with 83d116c53058 > reverted, and the below patch applied, the WARN_ON_ONCE does not > trigger. I cannot explain this. There is no locking to prevent the same scenario before. It might be an timing difference. Could try to put a delay before the copy to make race window larger? -- Kirill A. Shutemov