From patchwork Tue Sep 10 02:15:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13797730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33A82EDE994 for ; Tue, 10 Sep 2024 02:15:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B54B06B00CB; Mon, 9 Sep 2024 22:15:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADDCB6B00D7; Mon, 9 Sep 2024 22:15:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97ED36B00D8; Mon, 9 Sep 2024 22:15:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 79F756B00CB for ; Mon, 9 Sep 2024 22:15:51 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2FC2F16063C for ; Tue, 10 Sep 2024 02:15:51 +0000 (UTC) X-FDA: 82547212902.06.A68981B Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf06.hostedemail.com (Postfix) with ESMTP id D4DC8180006 for ; Tue, 10 Sep 2024 02:15:48 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725934466; a=rsa-sha256; cv=none; b=StLsYkhcBp9X+HJcpwF6PZghagMdJXhJ6305KUWB9jZ0pERzAdY9s03QwrO8AhnFmM5veu 1v2UKhTgp17S2/MdDU6FlsDLctDm0zzpccYPKJIBsMwCBDmJWX8IHIzSYLGmdYtH+cyK48 8/4+rHQlX4NKj5lOV+FwwDltNhYWbN4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725934466; h=from:from:sender: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=XAdpvr5sabo80Fw32Atdr0fGD5l3enBSa1VeOeJetN0=; b=eNjvBD7AVcXlb3D1HnbzepHdV96/ykoMF3FNAnHRXY7/5EUBKo9/+7pDCtI6S+1zzahWVO ewdqW+XOPWyp0F/4oRGNiJ7nJtYiXihYKF2jcS7xl4ON+T5fFpJ2rcM8qENuwQdx2QLMWH koiRDOVMCxT3hVde+m4X6f2YCCH1t4g= Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4X2nNq3Srnz20nlN; Tue, 10 Sep 2024 10:15:39 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id F12B0180041; Tue, 10 Sep 2024 10:15:43 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 10 Sep 2024 10:15:43 +0800 From: Kefeng Wang To: Andrew Morton CC: , Jane Chu , Miaohe Lin , Naoya Horiguchi , Tony Luck , Jiaqi Yan , David Hildenbrand , Kefeng Wang Subject: [PATCH] mm: support poison recovery from do_cow_fault() fix Date: Tue, 10 Sep 2024 10:15:41 +0800 Message-ID: <20240910021541.234300-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240906024201.1214712-2-wangkefeng.wang@huawei.com> References: <20240906024201.1214712-2-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D4DC8180006 X-Stat-Signature: mxodkckch6pp7z3ynsxeikd8kz3kuwwq X-Rspam-User: X-HE-Tag: 1725934548-954444 X-HE-Meta: U2FsdGVkX1/P0STGdiR4hCM+B8185ROEpIZyUVGAPpfUrXqVAQDUWRnfzimm0BkH6ZyjYpOeA6chpLsRPVF5PE7FVuUVVBFdYrO6a/xx6XKKFrm5tbufdVVmbfjTtUfLwdspqBRaBHgeTkP+yMqZ563slhRenDOmmflc+9LuvShmr0wfPbFUWbzyBUj/jN4Ahg/fo8Qi/b+gMF/dVBpeVWkVEj+7BNWh5Gs2FKUwVsgm828rqEy4thWHM35DMPD/50ZJQNUs1FeMUivc7/qGF2edYazxDjTWrwHq22ihrpkcdqYhG5Jnlm/RUqp5JnMeIJTgEopDBWrLHmlV/RNkbrNyqYT58/zeXOSe3fpQyh2ezZJ2txiocKpr64W0uyfmUU9BgFmJOOsnfdusiA6JH0ykXUlGJJBS0dtSTNET0qDA8QJi3AOk6KjmVFs9SbBjv2wF9oMjTVmf/qkoOeE+7FuOwtur2Dsz4+mGh9RtrrfCLbwVoicHqr3qOmGtdi/mP9j7BaR/V0Sngo4/insdVwDGb8+0x31K35cenm6niLigCCrfcIQqqrJXQ5rePnaBn5XVgiunawVxGgSuElhrXdKLvQheaNMkqRilHWu7Sb0rksYvi0ntFytIJ3STGoO3whr737eIbTXqko4h+SGVch195/4vndnt1ItXJjfeIQKTE8wOlpDStgcUqvANbejjTXRB+ZltbuMrz40dOH3g3KKKs+4xn/f1npX6BG7Yd7X6mLpT7mWIFgWKxwVi61mt+T4Obrb2ItOiXdrZapcVYuksb/LxkO5sXtd4LCXXcXBJ8v66pZ9iPRNlrNQGprUZ8rlQvLMl+tIbKWJ72zaWtrNqXcoUFO7+58lg5mqlm4Lf+s26CzHa+c3hHRhHLoLKk8ZGJoRzxvr5DYvLmEhAqNOUFUlZJtXR9xid9VAAuApDDzX+Sf9wL64XRFpS70hM6CK/bMfyDCgTTiQkVoJ 28QHqGqs bqTT4VLOreyNglZXER2Lw8/2lSh85UHVzAYZUjUiaC16pCPn95o5z8fiSFBAR6YlQ9oJ8f9RTyynJfrIr3vohJnFCmymLLeTy3XhLiu4C7B7GlcilwDt/jscLgX4VtcKaLn7jYHa8N+SSiEUi9YyRAd5eZX6VJzN5QRqFYt+TR3szBkgPhwc/9EP2sL9MVZKtRuoMOkRHF6trak6Wv0U0T5RXFU0Q1Pxd6ZsEBRT0bF2UKwBdE1zULZn4BUv7vNeQwGM7wtkZwXtHbrA= 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: List-Subscribe: List-Unsubscribe: unlock/put vmf->page, per Miaohe Signed-off-by: Kefeng Wang Reviewed-by: Miaohe Lin --- mm/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index b84443e689a8..47c0202136c9 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5096,11 +5096,12 @@ static vm_fault_t do_cow_fault(struct vm_fault *vmf) if (copy_mc_user_highpage(vmf->cow_page, vmf->page, vmf->address, vma)) { ret = VM_FAULT_HWPOISON; - goto uncharge_out; + goto unlock; } __folio_mark_uptodate(folio); ret |= finish_fault(vmf); +unlock: unlock_page(vmf->page); put_page(vmf->page); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))