The patch titled Subject: khugepaged: rename collapse_shmem() and khugepaged_scan_shmem() has been added to the -mm tree. Its filename is khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Song Liu <songliubraving@xxxxxx> Subject: khugepaged: rename collapse_shmem() and khugepaged_scan_shmem() Next patch will add khugepaged support of non-shmem files. This patch renames these two functions to reflect the new functionality: collapse_shmem() => collapse_file() khugepaged_scan_shmem() => khugepaged_scan_file() Link: http://lkml.kernel.org/r/20190801184244.3169074-6-songliubraving@xxxxxx Signed-off-by: Song Liu <songliubraving@xxxxxx> Acked-by: Rik van Riel <riel@xxxxxxxxxxx> Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Hillf Danton <hdanton@xxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: William Kucharski <william.kucharski@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/khugepaged.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) --- a/mm/khugepaged.c~khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem +++ a/mm/khugepaged.c @@ -1426,7 +1426,7 @@ static void retract_page_tables(struct a } /** - * collapse_shmem - collapse small tmpfs/shmem pages into huge one. + * collapse_file - collapse small tmpfs/shmem pages into huge one. * * Basic scheme is simple, details are more complex: * - allocate and lock a new huge page; @@ -1443,10 +1443,11 @@ static void retract_page_tables(struct a * + restore gaps in the page cache; * + unlock and free huge page; */ -static void collapse_shmem(struct mm_struct *mm, - struct address_space *mapping, pgoff_t start, +static void collapse_file(struct mm_struct *mm, + struct file *file, pgoff_t start, struct page **hpage, int node) { + struct address_space *mapping = file->f_mapping; gfp_t gfp; struct page *new_page; struct mem_cgroup *memcg; @@ -1702,11 +1703,11 @@ out: /* TODO: tracepoints */ } -static void khugepaged_scan_shmem(struct mm_struct *mm, - struct address_space *mapping, - pgoff_t start, struct page **hpage) +static void khugepaged_scan_file(struct mm_struct *mm, + struct file *file, pgoff_t start, struct page **hpage) { struct page *page = NULL; + struct address_space *mapping = file->f_mapping; XA_STATE(xas, &mapping->i_pages, start); int present, swap; int node = NUMA_NO_NODE; @@ -1770,16 +1771,15 @@ static void khugepaged_scan_shmem(struct result = SCAN_EXCEED_NONE_PTE; } else { node = khugepaged_find_target_node(); - collapse_shmem(mm, mapping, start, hpage, node); + collapse_file(mm, file, start, hpage, node); } } /* TODO: tracepoints */ } #else -static void khugepaged_scan_shmem(struct mm_struct *mm, - struct address_space *mapping, - pgoff_t start, struct page **hpage) +static void khugepaged_scan_file(struct mm_struct *mm, + struct file *file, pgoff_t start, struct page **hpage) { BUILD_BUG(); } @@ -1862,8 +1862,7 @@ skip: file = get_file(vma->vm_file); up_read(&mm->mmap_sem); ret = 1; - khugepaged_scan_shmem(mm, file->f_mapping, - pgoff, hpage); + khugepaged_scan_file(mm, file, pgoff, hpage); fput(file); } else { ret = khugepaged_scan_pmd(mm, vma, _ Patches currently in -mm which might be from songliubraving@xxxxxx are mm-move-memcmp_pages-and-pages_identical.patch uprobe-use-original-page-when-all-uprobes-are-removed.patch uprobe-use-original-page-when-all-uprobes-are-removed-v2.patch mm-thp-introduce-foll_split_pmd.patch mm-thp-introduce-foll_split_pmd-v11.patch uprobe-use-foll_split_pmd-instead-of-foll_split.patch khugepaged-enable-collapse-pmd-for-pte-mapped-thp.patch uprobe-collapse-thp-pmd-after-removing-all-uprobes.patch filemap-check-compound_headpage-mapping-in-filemap_fault.patch filemap-check-compound_headpage-mapping-in-pagecache_get_page.patch filemap-update-offset-check-in-filemap_fault.patch mmthp-stats-for-file-backed-thp.patch khugepaged-rename-collapse_shmem-and-khugepaged_scan_shmem.patch mmthp-add-read-only-thp-support-for-non-shmem-fs.patch mmthp-avoid-writes-to-file-with-thp-in-pagecache.patch