From patchwork Sat Jul 8 08:57:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13305631 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 BB691EB64DD for ; Sat, 8 Jul 2023 08:57:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 393108D0003; Sat, 8 Jul 2023 04:57:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31C4C8D0002; Sat, 8 Jul 2023 04:57:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BD9E8D0003; Sat, 8 Jul 2023 04:57:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id F2E368D0002 for ; Sat, 8 Jul 2023 04:57:37 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BEA444014A for ; Sat, 8 Jul 2023 08:57:37 +0000 (UTC) X-FDA: 80987841354.30.98E0C17 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf15.hostedemail.com (Postfix) with ESMTP id 52B8EA000B for ; Sat, 8 Jul 2023 08:57:34 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688806655; a=rsa-sha256; cv=none; b=QTBF1NdPJS+1bmOV3/xLbc4ftZczumgR5U/Qkx82X6d3OMII4wUQy/yJbNlA7dhi36S1an nYxgN/uMx1FUILGzpQ61xA5c2xmNexVucln0oaRhX+xdkADZz+aEc3UrFAGefJdefV9yM7 goajiSjZUomCxiRBnyTJrwjMfnkskcg= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688806655; 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=xHd3BS8xVECX7E/sxvVqFWVpfjPb2IafD1iyx6RNnLk=; b=EnlRCPQ3AMzQTPqB3d5jzN99egg00NlcOkoBVeo1KJoQKfwM+jmjeTNk1ONX1QCMaQSdcp A3/tm7cmc8UczH1/sQmpqbOuQLuzrSeDWxzML0oExtVBZO7Rd6iIUFoW06vm3jnT1eU0wI JqXbtVNnYrL9z7vrXRr997AED5QUBDE= Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QykfN4sfWz1FDfX; Sat, 8 Jul 2023 16:57:00 +0800 (CST) Received: from huawei.com (10.174.151.185) 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.2507.27; Sat, 8 Jul 2023 16:57:29 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH 3/8] mm: memory-failure: Don't account hwpoison_filter() filtered pages Date: Sat, 8 Jul 2023 16:57:39 +0800 Message-ID: <20230708085744.3599311-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230708085744.3599311-1-linmiaohe@huawei.com> References: <20230708085744.3599311-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 52B8EA000B X-Stat-Signature: qxcc4n7kxm3td3pg1kshdg9167o864n5 X-HE-Tag: 1688806654-922933 X-HE-Meta: U2FsdGVkX197fdbYPNMGYpk/uRRePt0CH/cHKdvxmyle6+YRf6rWx6lJz0dZS6ec8gcd6n2rRE1U6ami7JNrjZ9SeiSwwlEjiaWKR5ecAPF44AaSShYipMGYYHshMf8b24Aph4XPp9mKym7Dl8BRBDqculRegucmVk7yP+uQ+jDYgxdMVYPu3Ml+uLJR6mICJD2LmCf8iBiICwRrPXgy/y5vCp/TFoVSQ1HWFzhbaM+IfSSmquj7NsUEXrDCSD1zVpaLPSkyCma9Gc1/4EkT6qjRssQEztxd07tFhvT04vJaAMBUBAtl9WvBtZ91gz9e9NUvZWjDyGAz94KQGT/n1zwzeBO2oW8nqOjzGBKXon40XIy+uaaqj7NaEHKz6PVGrKkxx0BUpMuTcWnIEF7Ibsl7l9+F8NaAIKPXjZLxWSkhs7afTOnee1dIPD4GYX64kpqE4FqmlNSd4GEMqGrsTgbjxyrw+mBJ/5d876PjPyncsap/ydEWquoiepUonS4PFyEwBsWUFpfy47SmwbMd46XXpxHwYPIOUeO4n08qNxtCiUGUO+MocfCimK2d42jfZB7YvlcLKKoqTj8U+AyRSJ1S0QIfucM+ZqJ9kdyWjDqrL32AEl0n89j/jXyKYqTne0YCtn5zAhPYfSCaZS7V7nh/2Wtwc2KBSm5i3KEBj+oZ7Tpi+zYapafO8hWZC9xoWnpweVBpr7LdVUeETuSQIso/fg9e8K9kXZrd0A9COLbANYNrcd3AR4N8AI+p9a9BlrScGL2YvNU302xedYlskMkFgJAgSlMN3hM9eqo8b6kBPh5fJYpci6SnY6ZeXSB6cHfuATmmijiar4pMxVHz8V6vD5jPo0ancn9Tcp72Jdd6v9lUHI7SA8eVUF/sQwPherV0N8gvFSunSzbzL44CwrS8BDpwho4epGU/eWLLUS+xXstgPCa7nq6LkrGUCGQhB7uphFY4u9gN8J8Q9Mg 3qkEksAc XOzMas2UKnY2V3DDyOsMbK/JyRqAUMPGjPor61QUrzeZE875LNyoj86BjyJZDs6+dpulternqWji5hSxvP5UDqAbElBqMS8ncnhUeOPLa48xLNNbrkpN/65tXnB++HBlQE76h01hOmF/+OGprOoZ0CuJ4FssbK766CcAi21BZIvfb7vjh3P9bvXZlVJXTbIh0Fyht 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: mf_generic_kill_procs() will return -EOPNOTSUPP when hwpoison_filter() filtered dax page. In that case, action_result() isn't expected to be called to update mf_stats. This will results in inaccurate but benign memory failure handling statistics. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c155122e3c66..905758af70f3 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2101,7 +2101,8 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, out: /* drop pgmap ref acquired in caller */ put_dev_pagemap(pgmap); - action_result(pfn, MF_MSG_DAX, rc ? MF_FAILED : MF_RECOVERED); + if (rc != -EOPNOTSUPP) + action_result(pfn, MF_MSG_DAX, rc ? MF_FAILED : MF_RECOVERED); return rc; }