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=-5.8 required=3.0 tests=BAYES_00,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 77584C433ED for ; Thu, 6 May 2021 07:02:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EEC02611AC for ; Thu, 6 May 2021 07:02:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEC02611AC Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4A4EB6B006C; Thu, 6 May 2021 03:02:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 455626B006E; Thu, 6 May 2021 03:02:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F55B6B0070; Thu, 6 May 2021 03:02:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 131F46B006C for ; Thu, 6 May 2021 03:02:53 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C195E8249980 for ; Thu, 6 May 2021 07:02:52 +0000 (UTC) X-FDA: 78109913784.36.15E9D51 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf09.hostedemail.com (Postfix) with ESMTP id DFDCA600010A for ; Thu, 6 May 2021 07:02:42 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1620284571; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=S5eja9I0EQLqYhrMODxAXlUryd/r1+oYlgXc94+Yz3c=; b=K6u7ICpEtgBND/9O5ZdhYg8ZGnPEAe4sn/tzru5Yf5/40/vGOyOrYtcG/o4JSjFC71XAQt 7switeqQgjviJ7SZgyxCCiSQzVndEumBv/nLrct/ONo1GtsLIoaRh3q7Q1gG3y5f0DU2+O TXYr+Ia0X8nf/3Un/P6/vuhTMBOEepA= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4010DB1FA; Thu, 6 May 2021 07:02:51 +0000 (UTC) Date: Thu, 6 May 2021 09:02:50 +0200 From: Michal Hocko To: Aili Yao Cc: Andrew Morton , David Hildenbrand , linux-mm@kvack.org, LKML , yaoaili126@gmail.com Subject: Re: [PATCH] Revert "mm/gup: check page posion status for coredump." Message-ID: References: <20210505135407.31590-1-mhocko@kernel.org> <20210506134750.17d2f6eb@alex-virtual-machine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210506134750.17d2f6eb@alex-virtual-machine> Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=K6u7ICpE; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.15 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam03 X-Stat-Signature: dhxf5rmw3bhdstde66qy4azb4ztbp4hk X-Rspamd-Queue-Id: DFDCA600010A Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620284562-867594 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 Thu 06-05-21 13:47:50, Aili Yao wrote: > 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. Please propose a new fix which a) doesn't leak a page reference b) evaluates how realistic is the scenario c) explain why any other gup user doesn't really need to care - or in other words is the gup layer really suitable for this issue? -- Michal Hocko SUSE Labs