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=-4.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 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 6EF24C43460 for ; Thu, 6 May 2021 05:48:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 09B40613B5 for ; Thu, 6 May 2021 05:48:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09B40613B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kingsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4E5316B006C; Thu, 6 May 2021 01:48:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 481D36B006E; Thu, 6 May 2021 01:48:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D4826B0070; Thu, 6 May 2021 01:48:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 114A96B006C for ; Thu, 6 May 2021 01:48:03 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B9742180AD830 for ; Thu, 6 May 2021 05:48:02 +0000 (UTC) X-FDA: 78109725204.33.DEC9CE3 Received: from mail.kingsoft.com (unknown [114.255.44.146]) by imf29.hostedemail.com (Postfix) with ESMTP id CEBD7FC for ; Thu, 6 May 2021 05:47:54 +0000 (UTC) X-AuditID: 0a580155-c6bff700000401e3-1b-6093830d3bcd Received: from mail.kingsoft.com (localhost [10.88.1.79]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.kingsoft.com (SMG-2-NODE-85) with SMTP id 3A.8B.00483.D0383906; Thu, 6 May 2021 13:47:57 +0800 (HKT) Received: from alex-virtual-machine (10.88.1.103) by KSBJMAIL4.kingsoft.cn (10.88.1.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 6 May 2021 13:47:56 +0800 Date: Thu, 6 May 2021 13:47:50 +0800 From: Aili Yao To: Michal Hocko CC: Andrew Morton , David Hildenbrand , , LKML , Michal Hocko , Subject: Re: [PATCH] Revert "mm/gup: check page posion status for coredump." Message-ID: <20210506134750.17d2f6eb@alex-virtual-machine> In-Reply-To: <20210505135407.31590-1-mhocko@kernel.org> References: <20210505135407.31590-1-mhocko@kernel.org> Organization: kingsoft X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.88.1.103] X-ClientProxiedBy: KSBJMAIL1.kingsoft.cn (10.88.1.31) To KSBJMAIL4.kingsoft.cn (10.88.1.79) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFLMWRmVeSWpSXmKPExsXCFcHor8vbPDnBYGq/hsWc9WvYLL6u/8Vs cXnXHDaLe2v+s1q8/raM2eJ+n4PFs9arLA7sHjtn3WX32LSqk81j06dJ7B4nZvxm8Xi/7yqb x/otV1k8Pm+SC2CP4rJJSc3JLEst0rdL4MrYfGAWe8ExroqvB1eyNTDu4uhi5OSQEDCReLb1 HHMXIxeHkMB0Jok9V5oYIZxnjBLz2yeygVSxCKhIXD88lxXEZhNQldh1bxaYLQIUX993hx2k gVngDKPExXmbmUASwgI+ErN717GD2LwCVhLLl10Di3MKmEv8aZ0CtIEDaIOZRPeDaJAwv4CY RO+V/0wgYQkBe4nH6xUhOgUlTs58wgJiMwvoSJxYdYwZwpaX2P52DpgtJKAocXjJL3aIZ+Ql 7v6ezghhx0o0HbjFNoFReBaSUbOQjJqFZNQCRuZVjCzFuelGmxgh0RG6g3FG00e9Q4xMHIyH GCU4mJVEeAvW9icI8aYkVlalFuXHF5XmpBYfYpTmYFES52Uv7EoQEkhPLEnNTk0tSC2CyTJx cEo1MHm0Nuv1FtyqT/ug2mbJ22Tl2L7TVkN7wmWxBV/9ovP8rJZqRr7+dOMlr2fWsU2mVqKx 5gKhB0/t/nn9jOaDF+tur+lln/7OKCXl9Qr3y7MfTnkSEG6kcynz4PapdYeV8qaKRhkc/rfl dKPey/aCy8utd4h4PHysPt36qWjP5jhVFfsI1dN1h7e8fPjHbP8Hi4debjuOdF/bf1lxsaKk 4cWnO3oSO7P+XShpPBK1qWxrfEeDo0Xa1acNJ7/ESzbuPuN/c1bYvt3cQYXdh1rctHy12JaF /K8/URguYH9V4RnX+1mzP9a09CXXufx2TVUp1pTftXuJeqlA8MczLdZPVpcoLbXa1cB25eX6 iPbNYUosxRmJhlrMRcWJAH3/FZf9AgAA X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CEBD7FC X-Stat-Signature: g8e4wbuefmcufn9wqm7bq3zoo5ocssm8 Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf29.hostedemail.com: domain of yaoaili@kingsoft.com designates 114.255.44.146 as permitted sender) smtp.mailfrom=yaoaili@kingsoft.com Received-SPF: none (kingsoft.com>: No applicable sender policy available) receiver=imf29; identity=mailfrom; envelope-from=""; helo=mail.kingsoft.com; client-ip=114.255.44.146 X-HE-DKIM-Result: none/none X-HE-Tag: 1620280074-25330 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: On Wed, 5 May 2021 15:54:07 +0200 Michal Hocko wrote: > From: Michal Hocko > > While reviewing http://lkml.kernel.org/r/20210429122519.15183-4-david@redhat.com > I have crossed d3378e86d182 ("mm/gup: check page posion status for > coredump.") and noticed that this patch is broken in two ways. First it > doesn't really prevent hwpoison pages from being dumped because hwpoison > pages can be marked asynchornously at any time after the check. I rethink this: There are two cases for this coredump panic issue. One is the scenario that the hwpoison flag is set correctly, and the previous patch will make it recoverable and avoid panic. Another is the hwpoison flag not valid in the check, maybe race condition. I don't think this case is worth and reliazable to be covered. As the SRAR can happen freshly in the dump process and thus can't be detected. And the previous patch doesn't make the Another case worse and unacceptable. just as it can't be covered. So here is the patch: For most case in this topic, the patch will work. For the case hwpoison flag not valid, it will fallback to the original process before this patch --- just panic. And i don't think we need to consider the minor case as you have said the posion can happen any time. Thanks! Aili Yao