Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commitfece202

Browse files
kiryltorvalds
authored andcommitted
mm/khugepaged.c: convert VM_BUG_ON() to collapse fail
khugepaged is not yet able to convert PTE-mapped huge pages back to PMDmapped. We do not collapse such pages. See checkkhugepaged_scan_pmd().But if between khugepaged_scan_pmd() and __collapse_huge_page_isolate()somebody managed to instantiate THP in the range and then split the PMDback to PTEs we would have a problem --VM_BUG_ON_PAGE(PageCompound(page)) will get triggered.It's possible since we drop mmap_sem during collapse to re-take forwrite.Replace the VM_BUG_ON() with graceful collapse fail.Link:http://lkml.kernel.org/r/20180315152353.27989-1-kirill.shutemov@linux.intel.comFixes:b1caa95 ("khugepaged: ignore pmd tables with THP mapped with ptes")Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>Cc: Laura Abbott <labbott@redhat.com>Cc: Jerome Marchand <jmarchan@redhat.com>Cc: Vlastimil Babka <vbabka@suse.cz>Cc: <stable@vger.kernel.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent28ee90f commitfece202

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎mm/khugepaged.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,12 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
530530
gotoout;
531531
}
532532

533-
VM_BUG_ON_PAGE(PageCompound(page),page);
533+
/* TODO: teach khugepaged to collapse THP mapped with pte */
534+
if (PageCompound(page)) {
535+
result=SCAN_PAGE_COMPOUND;
536+
gotoout;
537+
}
538+
534539
VM_BUG_ON_PAGE(!PageAnon(page),page);
535540

536541
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp