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,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 D2EC1C35242 for ; Tue, 11 Feb 2020 17:55:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9D34F206CC for ; Tue, 11 Feb 2020 17:55:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WSnSILjC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D34F206CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B8006B0306; Tue, 11 Feb 2020 12:55:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4696B6B0307; Tue, 11 Feb 2020 12:55:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A5EF6B0308; Tue, 11 Feb 2020 12:55:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id 207886B0306 for ; Tue, 11 Feb 2020 12:55:59 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B449F181AC9CC for ; Tue, 11 Feb 2020 17:55:58 +0000 (UTC) X-FDA: 76478599596.01.club25_6e50106a0e311 X-HE-Tag: club25_6e50106a0e311 X-Filterd-Recvd-Size: 4061 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Feb 2020 17:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581443757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0VEoUCkYeb1vmcT7jZTiX/0EtqEeyifqYtBQyB/s0Jk=; b=WSnSILjC5yKZnMRLYD5AWU9hE+HyxbY2CKvjnFhrAbFE8uaeoB00itgFzVhj0M4UFfLscl OXD0WU+FWMIjmdqwMIyox7i2wIo+9KPlaid3WjRHpkfPcSXTJ2sovYUqbiLnMv6Xpyza/7 o/BylUqw+b4h43HUhbRla3l7xdMUTu4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-11-XHjWgmZUPBmn1H786XVraw-1; Tue, 11 Feb 2020 12:55:53 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CE62107ACC5; Tue, 11 Feb 2020 17:55:52 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4701560BF1; Tue, 11 Feb 2020 17:55:51 +0000 (UTC) From: Jeff Moyer To: "Kirill A. Shutemov" 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") References: <20200211173352.wjm6govzcqy355y7@box> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Tue, 11 Feb 2020 12:55:50 -0500 In-Reply-To: <20200211173352.wjm6govzcqy355y7@box> (Kirill A. Shutemov's message of "Tue, 11 Feb 2020 20:33:52 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: XHjWgmZUPBmn1H786XVraw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: "Kirill A. Shutemov" writes: > On Tue, Feb 11, 2020 at 11:44:06AM -0500, Jeff Moyer wrote: >> Hi, Justin, >>=20 >> 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 refin= es >> >> 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 wit= h >> > 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 >>=20 >> 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? I reverted my change to the reproducer, and now it triggers the warning. -Jeff