diff mbox series

[5/6] mm, hwpoison: check PageTable() explicitly in hwpoison_user_mappings()

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

Commit Message

Miaohe Lin Aug. 30, 2022, 12:36 p.m. UTC
PageTable can't be handled by memory_failure(). Filter it out explicitly in
hwpoison_user_mappings(). This will also make code more consistent with the
relevant check in unpoison_memory().

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

HORIGUCHI NAOYA(堀口 直也) Sept. 5, 2022, 5:25 a.m. UTC | #1
On Tue, Aug 30, 2022 at 08:36:03PM +0800, Miaohe Lin wrote:
> PageTable can't be handled by memory_failure(). Filter it out explicitly in
> hwpoison_user_mappings(). This will also make code more consistent with the
> relevant check in unpoison_memory().
> 
> 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 904c2b6284a4..fb6a10005109 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1406,7 +1406,7 @@  static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
 	 * Here we are interested only in user-mapped pages, so skip any
 	 * other types of pages.
 	 */
-	if (PageReserved(p) || PageSlab(p))
+	if (PageReserved(p) || PageSlab(p) || PageTable(p))
 		return true;
 	if (!(PageLRU(hpage) || PageHuge(p)))
 		return true;