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

Message ID 20230711055016.2286677-4-linmiaohe@huawei.com
State New
Headers
Series A few fixup and cleanup patches for memory-failure |

Commit Message

Miaohe Lin July 11, 2023, 5:50 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>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
---
 mm/memory-failure.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

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