[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210715150852.1655-1-wangbin224@huawei.com>
Date: Thu, 15 Jul 2021 23:08:52 +0800
From: Bin Wang <wangbin224@...wei.com>
To: <linux-mm@...ck.org>
CC: <naoya.horiguchi@....com>, <akpm@...ux-foundation.org>,
<wuxu.wu@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] mm/hwpoison: dissolve error hugepages of file mapping
We handle error on hugetlb file with hugetlbfs_error_remove_page(),
which removes the error hugepages from page cache. And with the
HWPoison flag in head page, it is safe to free the error hugepages
and dissolve it.
Fixes: 78bb920344b8a ("mm: hwpoison: dissolve in-use hugepage in unrecoverable memory error")
Signed-off-by: Bin Wang <wangbin224@...wei.com>
---
mm/memory-failure.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index eefd823deb67..6a3c46b601ef 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -988,6 +988,13 @@ static int me_huge_page(struct page *p, unsigned long pfn)
if (mapping) {
res = truncate_error_page(hpage, pfn, mapping);
unlock_page(hpage);
+ if (ret == MF_RECOVERED) {
+ put_page(hpage);
+ if (__page_handle_poison(p))
+ page_ref_inc(p);
+ else
+ ret = MF_FAILED;
+ }
} else {
res = MF_FAILED;
unlock_page(hpage);
--
2.23.0
Powered by blists - more mailing lists