[PATCH] mm/huge_memory: remove outdated VM_WARN_ON_ONCE_PAGE from unmap_page()

From: David Hildenbrand
Date: Sat Mar 19 2022 - 06:49:39 EST


We can already theoretically fail to unmap (still having page_mapped()) in
case arch_unmap_one() fails. Although this applies only to anonymous pages
for now, get rid of the VM_WARN_ON_ONCE_PAGE() completely: the caller --
split_huge_page_to_list() -- will fail to freeze the refcount and
remap the page via remap_page(). So the caller can handle unmap errors
just fine.

This is a preparation for making try_to_migrate() fail on anonymous pages
with GUP pins.

Reported-by: Yang Shi <shy828301@xxxxxxxxx>
Signed-off-by: David Hildenbrand <david@xxxxxxxxxx>
---
mm/huge_memory.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 0b6fb409b9e4..0fe0ab3ec3fc 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2263,8 +2263,6 @@ static void unmap_page(struct page *page)
try_to_migrate(page, ttu_flags);
else
try_to_unmap(page, ttu_flags | TTU_IGNORE_MLOCK);
-
- VM_WARN_ON_ONCE_PAGE(page_mapped(page), page);
}

static void remap_page(struct page *page, unsigned int nr)
--
2.35.1


--
Thanks,

David / dhildenb