diff mbox series

[3/8] mm: memory-failure: Don't account hwpoison_filter() filtered pages

Message ID 20230708085744.3599311-4-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few fixup and cleanup patches for memory-failure | expand

Commit Message

Miaohe Lin July 8, 2023, 8:57 a.m. UTC
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 <linmiaohe@huawei.com>
---
 mm/memory-failure.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Markus Elfring July 8, 2023, 11:02 a.m. UTC | #1
> 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.

Please choose another imperative change suggestion (also without a typo).

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.4#n94

Regards,
Markus
Naoya Horiguchi July 10, 2023, 7:56 a.m. UTC | #2
On Sat, Jul 08, 2023 at 04:57:39PM +0800, Miaohe Lin wrote:
> 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.

Nice catch.

> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
diff mbox series

Patch

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;
 }