[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250702093440.146967-1-18810879172@163.com>
Date: Wed, 2 Jul 2025 17:34:40 +0800
From: 18810879172@....com
To: akpm@...ux-foundation.org
Cc: david@...hat.com,
zhengqi.arch@...edance.com,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
wangxuewen <wangxuewen@...inos.cn>
Subject: [PATCH v1] mm/vmscan: Account hwpoisoned folios in reclaim statistics
From: wangxuewen <wangxuewen@...inos.cn>
When encountering a hardware-poisoned folio in shrink_folio_list(),
we unmap and release the folio but fail to account it in the reclaim
statistics (sc->nr_reclaimed). This leads to an undercount of
actually reclaimed pages, potentially causing unnecessary additional
reclaim pressure.
Fix this by adding sc->nr_reclaimed += folio_nr_pages(folio) after
folio_put() in the hwpoison handling block. This matches the accounting
done in other reclaim paths.
Signed-off-by: wangxuewen <wangxuewen@...inos.cn>
---
mm/vmscan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index f8dfd2864bbf..4c612f4b6e66 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1141,6 +1141,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
unmap_poisoned_folio(folio, folio_pfn(folio), false);
folio_unlock(folio);
folio_put(folio);
+ sc->nr_reclaimed += folio_nr_pages(folio);
continue;
}
--
2.34.1
Powered by blists - more mailing lists