Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1106456pxy; Thu, 6 May 2021 00:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTHMgQAiZN/r6EIsc955B1WuTgkxpVW4K+ynX+Q/i3c7t1x6nXp68tvAuEi5Hv2uELAf7B X-Received: by 2002:a62:6101:0:b029:215:3a48:4e6e with SMTP id v1-20020a6261010000b02902153a484e6emr3155162pfb.2.1620284715156; Thu, 06 May 2021 00:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620284715; cv=none; d=google.com; s=arc-20160816; b=jnQOg3s1O8xfCDwcX6rrgG3DjarA7Vbi2WHaZwrpg2c6swchN3T/kx3Tr3VWlQIRVb WI/A9kMwg6YTkBI4bFC7TAQ0mvASPQBOelPQ9MWDnFlE1El0LqdMqseYa4pIGTPqDh3s hnSOVeUezSFs6ieRGwatFOPpdTkYTpq9auvXzq2Ei0mtGQaEdVoKW4Qt9t9chBK/gSSk a375WPSBqT7xe/G0lAyyDO7B46hF7xauRB5EerdWzIjHWuVkHlE5eBDMcghWrYnyvbFr YwluFtYClIYYkbcCso3zyR4P76DjysesOaiznrOYK0chZeRz+XH/Uq2s3scC9oqxFsFR hoaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S5eja9I0EQLqYhrMODxAXlUryd/r1+oYlgXc94+Yz3c=; b=BMwXqA9NrydhKsb3t7/iuJ9I/6aKl5bytCsmyMiBWcX1X5TkPkEefwrs4D2pCPC33c M2DHzJytqmELt1JllXeNeA/jo9LU4Yjcz+cbMzm33p8d7b2FR+rwrvWgOi5wFXp5Bd+G eQ7JKiAw6XGrNwDT4rI88xTDVLinOOuqfCtCkCpg+SY2tLyVUXxWxmbw+ZEydL3qAH9r XI3IK4MVHGFTldMU3xtWS62XzJ3IAIs3i2wE97QIWOW6anFux8QftkfL/A7uPOsC+Rbk f4PSWjC7nJ6rdCsO9k1MohNbNFFritgGuTR+5yh7v7l6f+nKXOeJpt/v909URBLW4ZYY EGPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=K6u7ICpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si2073405pgk.293.2021.05.06.00.05.02; Thu, 06 May 2021 00:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=K6u7ICpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233120AbhEFHDu (ORCPT + 99 others); Thu, 6 May 2021 03:03:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:37276 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232876AbhEFHDt (ORCPT ); Thu, 6 May 2021 03:03:49 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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