mm-khugepaged-collapse_shmem-do-not-crash-on-compound.patch removed from -mm tree
The patch titled
Subject: mm/khugepaged: collapse_shmem() do not crash on Compound
has been removed from the -mm tree. Its filename was
mm-khugepaged-collapse_shmem-do-not-crash-on-compound.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Hugh Dickins <[email protected]>
Subject: mm/khugepaged: collapse_shmem() do not crash on Compound
collapse_shmem()'s VM_BUG_ON_PAGE(PageTransCompound) was unsafe: before it holds page lock of the first page, racing truncation then extension might conceivably have inserted a hugepage there already. Fail with the SCAN_PAGE_COMPOUND result, instead of crashing (CONFIG_DEBUG_VM=y) or otherwise mishandling the unexpected hugepage - though later we might code up a more constructive way of handling it, with SCAN_SUCCESS.
---
mm/khugepaged.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
mm/khugepaged.c renamed from mm/khugepaged.c~mm-khugepaged-collapse_shmem-do-not-crash-on-compound +9 -1
@@ -1399,7 +1399,15 @@ static void collapse_shmem(struct mm_str*/ VM_BUG_ON_PAGE (!PageLocked (page), page);VM_BUG_ON_PAGE (!PageUptodate (page), page); -VM_BUG_ON_PAGE (PageTransCompound (page), page); + +/* +* If file was truncated then extended, or hole-punched, before +* we locked the first page, then a THP might be there already. +*/ +if (PageTransCompound (page)) { + result =SCAN_PAGE_COMPOUND ; + goto out_unlock; + }if (page_mapping (page) != mapping) { result =SCAN_TRUNCATED ;
_
Patches currently in -mm which might be from [email protected] are
mm-put_and_wait_on_page_locked-while-page-is-migrated.patch