From patchwork Tue Jul 11 05:50:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 118271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp267806vqm; Mon, 10 Jul 2023 23:02:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxFOnRRmDK7n1mA5KzfwHamdBA1JK9USSaMxFNqzOz1x1HsHx8NWx8RCkcBAUL2SrlFMyF X-Received: by 2002:a05:6a20:483:b0:12e:6a31:37e1 with SMTP id 3-20020a056a20048300b0012e6a3137e1mr11577353pzc.61.1689055325403; Mon, 10 Jul 2023 23:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689055325; cv=none; d=google.com; s=arc-20160816; b=h9dCTP4VYQFehORIv5ZQ+x0pb21AlGnV1L4OpnMOrnJqT7EZU2/8wom0dlZVfK1LUK s/Hw7RsUYviYLxXrQPd8UxH67Vs388Q7TitXHyQPFUHRsc6keI29iEwLSJacEsTnFm44 mCIX132I605b8RYo3l4fAY/431Xp2emouRptnp7M0cP78TCp84hGrW/6o8GKaKdqDI2D 6cPJrCBrP6lr4ifZJLgKavJS3nJTBai3LTpDpYTkqtKh/u5lt4O3owD9Rt/FJPbSWDBp dwhSfA6xxr9NxBVzJt4uPGZl3Owb+z1p/oG9mqkOY98FyDz1MtY/w4qBPCkE5KtRvB46 v5jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rbVV6E6KX9xBwZyFWx2W1vSds59LeiPIy1pErc9efjo=; fh=4o7DIXI/66oHEW09L3854GeQKXh9nrvBy5ZxENMFBvA=; b=FxmHHekNFGVIXQILesTgMAJZ49QY1hoxuXMtKNYbufM9d8TlETvQMikUC3TQVU0Q/3 3+X6uqnbMCLhkkdlTq6kSDRiDCvNSDGM7/k/pCAxXn0HwDl93jxiZaCjvetAcBnVxl1K 6/3Ktkm0A2pEWqwljK0MLYzfpyH+95QmggUEb1uHsEuALqeH6alMZMde7Spscw92GHrF aKPZ+PGzL+scrT6TxtEamL4Kb+KksUzbHm2z7ceNTzjwz+PIq0fX4WxufRHbk7Kzp/Qr W9nfeDIpIDMB8jg1IaGXl3iTwdgzyPtCqyro9qPqsAocIcz9zrA680dZ96zZKuBTMPRl qNmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id im23-20020a170902bb1700b001ab29e00303si979565plb.426.2023.07.10.23.01.42; Mon, 10 Jul 2023 23:02:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbjGKFuK (ORCPT + 99 others); Tue, 11 Jul 2023 01:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjGKFuH (ORCPT ); Tue, 11 Jul 2023 01:50:07 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA1B71A4 for ; Mon, 10 Jul 2023 22:50:05 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4R0VLd6GMlz1FDpF; Tue, 11 Jul 2023 13:49:29 +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; Tue, 11 Jul 2023 13:50:02 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH v2 3/8] mm: memory-failure: Don't account hwpoison_filter() filtered pages Date: Tue, 11 Jul 2023 13:50:11 +0800 Message-ID: <20230711055016.2286677-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230711055016.2286677-1-linmiaohe@huawei.com> References: <20230711055016.2286677-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771102877064561785 X-GMAIL-MSGID: 1771102877064561785 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 feca3c4068a5..c80b7d9505d8 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2108,7 +2108,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; }