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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FB14C19F29 for ; Thu, 4 Aug 2022 03:19:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 440018E0008; Wed, 3 Aug 2022 23:19:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C8238E0001; Wed, 3 Aug 2022 23:19:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 269468E0008; Wed, 3 Aug 2022 23:19:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 101C08E0001 for ; Wed, 3 Aug 2022 23:19:17 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DBE27816FE for ; Thu, 4 Aug 2022 03:19:16 +0000 (UTC) X-FDA: 79760454312.14.CDC0B4D Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf21.hostedemail.com (Postfix) with ESMTP id 257891C0131 for ; Thu, 4 Aug 2022 03:19:14 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Lyv516n9fz1M8bC; Thu, 4 Aug 2022 11:16:05 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 4 Aug 2022 11:19:08 +0800 Subject: Re: [PATCH] mm/memory-failure: release private data before split THP To: Yin Fengwei CC: , , , Linux-MM , HORIGUCHI NAOYA , Matthew Wilcox References: <20220804025121.4001361-1-fengwei.yin@intel.com> From: Miaohe Lin Message-ID: <85e14a18-2797-760c-bb45-64ff217007b1@huawei.com> Date: Thu, 4 Aug 2022 11:19:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220804025121.4001361-1-fengwei.yin@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659583155; a=rsa-sha256; cv=none; b=a3tJuiXa1JEkbQZa41drSJgygrSDuTdQQSn3kuqnUCMcZYGZ/9OnZd8pTG9ubMJTGyIZpW is3Guo4wSwFlNkLoBnuRSYdIe+s8HZH199B3gbi9npkbzE0MCv41sTmukw9eVPeIXQVH5w xA4B8Rjen3zKtePE8IPXC31UG80352w= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659583155; 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=uRxWBMoJonHm+vCtkevXK/poHBzfsRANuVAC3ZpJLfw=; b=mL/qoS+sb0mm6qV7RdVbLsq1a57fFsu9X44vX3crDe4leau3G+HX+ZnZ1FRN1pn0olp/It ValuPnm0Kj2OJNV66ygQFpLU6wSWmi2p87iwMLOQTXTQ+icYkgktlWMCISbtCXLY/aRFWJ mD+drrnPuPsaBwNs24K0copFtOOfzVU= X-Rspam-User: X-Stat-Signature: m1wq4cajiyn8thmmrz97qxxkzrst3eri X-Rspamd-Queue-Id: 257891C0131 Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam02 X-HE-Tag: 1659583154-982439 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 2022/8/4 10:51, Yin Fengwei wrote: > If there is private data attached to THP, the refcount of > THP will be increased and block the THP split. Which could > further cause the meomry failure not recovered. > > Release private data attached to THP before split it to > increase the chance of splitting THP successfully. > > The issue was hit during HW error injection testing with > 5.18 kernel + xfs as rootfs, test got killed and system > reboot was required to re-run the test. > > The issue was tracked down to THP split failure caused the > memory failure not being handled. The page dump showed: > > [ 1785.433075] page:0000000025f9530b refcount:18 mapcount:0 mapping:000000008162eea7 index:0xa10 pfn:0x2f0200 > [ 1785.443954] head:0000000025f9530b order:4 compound_mapcount:0 compound_pincount:0 > [ 1785.452408] memcg:ff4247f2d28e9000 > [ 1785.456304] aops:xfs_address_space_operations ino:8555182 dentry name:"baseos-filenames.solvx" > [ 1785.466612] flags: 0x1000000000012036(referenced|uptodate|lru|active|private|head|node=0|zone=2) > [ 1785.476514] raw: 1000000000012036 ffb9460f8bc07c08 ffb9460f8bc08408 ff4247f22e6299f8 > [ 1785.485268] raw: 0000000000000a10 ff4247f194ade900 00000012ffffffff ff4247f2d28e9000 > > It was like the error was injected to a large folio for xfs with > private data attached. > > With private data released before split THP, the test case > could be run successfully many times without reboot system. > > Co-developed-by: Qiuxu Zhuo > Signed-off-by: Qiuxu Zhuo > Signed-off-by: Yin Fengwei > Suggested-by: Matthew Wilcox > Reviewed-by: Aaron Lu > --- Looks good to me. Thanks. Reviewed-by: Miaohe Lin