The patch titled Subject: mmthp-recheck-each-page-before-collapsing-file-thp-v4 has been removed from the -mm tree. Its filename was mmthp-recheck-each-page-before-collapsing-file-thp-v4.patch This patch was dropped because it was folded into mmthp-recheck-each-page-before-collapsing-file-thp.patch ------------------------------------------------------ From: Song Liu <songliubraving@xxxxxx> Subject: mmthp-recheck-each-page-before-collapsing-file-thp-v4 Trigger filemap_flush() for PageDirty() case. This covers one-off situation, where the file hasn't been flushed since first write. Link: http://lkml.kernel.org/r/20191022191006.411277-1-songliubraving@xxxxxx Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Signed-off-by: Song Liu <songliubraving@xxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: William Kucharski <william.kucharski@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/khugepaged.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) --- a/mm/khugepaged.c~mmthp-recheck-each-page-before-collapsing-file-thp-v4 +++ a/mm/khugepaged.c @@ -1636,11 +1636,20 @@ static void collapse_file(struct mm_stru goto out_unlock; } - /* - * khugepaged should not try to collapse dirty pages for - * file THP. Show warning if this somehow happens. - */ - if (WARN_ON_ONCE(!is_shmem && PageDirty(page))) { + if (!is_shmem && PageDirty(page)) { + /* + * khugepaged only works on read-only fd, so this + * page is dirty because it hasn't been flushed + * since first write. There won't be new dirty + * pages. + * + * Trigger async flush here and hope the writeback + * is done when khugepaged revisits this page. + * + * This is a one-off situation. We are not forcing + * writeback in loop. + */ + filemap_flush(mapping); result = SCAN_FAIL; goto out_unlock; } _ Patches currently in -mm which might be from songliubraving@xxxxxx are mmthp-recheck-each-page-before-collapsing-file-thp.patch mmthp-recheck-each-page-before-collapsing-file-thp-v4-fix.patch