The patch titled Subject: mm-gup-track-foll_pin-pages-fix-2-fix has been added to the -mm tree. Its filename is mm-gup-track-foll_pin-pages-fix-2-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-gup-track-foll_pin-pages-fix-2-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-gup-track-foll_pin-pages-fix-2-fix.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: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: mm-gup-track-foll_pin-pages-fix-2-fix fix put_compound_head defined but not used Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Cc: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> Cc: John Hubbard <jhubbard@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/gup.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) --- a/mm/gup.c~mm-gup-track-foll_pin-pages-fix-2-fix +++ a/mm/gup.c @@ -78,21 +78,6 @@ static __maybe_unused struct page *try_g return NULL; } -static void put_compound_head(struct page *page, int refs, unsigned int flags) -{ - if (flags & FOLL_PIN) - refs *= GUP_PIN_COUNTING_BIAS; - - VM_BUG_ON_PAGE(page_ref_count(page) < refs, page); - /* - * Calling put_page() for each ref is unnecessarily slow. Only the last - * ref needs a put_page(). - */ - if (refs > 1) - page_ref_sub(page, refs - 1); - put_page(page); -} - /** * try_grab_page() - elevate a page's refcount by a flag-dependent amount * @@ -1967,7 +1952,24 @@ EXPORT_SYMBOL(get_user_pages_unlocked); * This code is based heavily on the PowerPC implementation by Nick Piggin. */ #ifdef CONFIG_HAVE_FAST_GUP + +static void put_compound_head(struct page *page, int refs, unsigned int flags) +{ + if (flags & FOLL_PIN) + refs *= GUP_PIN_COUNTING_BIAS; + + VM_BUG_ON_PAGE(page_ref_count(page) < refs, page); + /* + * Calling put_page() for each ref is unnecessarily slow. Only the last + * ref needs a put_page(). + */ + if (refs > 1) + page_ref_sub(page, refs - 1); + put_page(page); +} + #ifdef CONFIG_GUP_GET_PTE_LOW_HIGH + /* * WARNING: only to be used in the get_user_pages_fast() implementation. * _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are memcg-fix-null-pointer-dereference-in-__mem_cgroup_usage_unregister_event-fix.patch mm-hotplug-fix-hot-remove-failure-in-sparsememvmemmap-case-fix.patch mm.patch mm-gup-track-foll_pin-pages-fix-2-fix.patch memcg-optimize-memorynuma_stat-like-memorystat-fix.patch selftest-add-mremap_dontunmap-selftest-fix.patch selftest-add-mremap_dontunmap-selftest-v7-checkpatch-fixes.patch hugetlb_cgroup-add-reservation-accounting-for-private-mappings-fix.patch hugetlb_cgroup-add-accounting-for-shared-mappings-fix.patch mm-migratec-migrate-pg_readahead-flag-fix.patch proc-faster-open-read-close-with-permanent-files-checkpatch-fixes.patch linux-next-rejects.patch linux-next-fix.patch mm-add-vm_insert_pages-fix.patch net-zerocopy-use-vm_insert_pages-for-tcp-rcv-zerocopy-fix.patch seq_read-info-message-about-buggy-next-functions-fix.patch drivers-tty-serial-sh-scic-suppress-warning.patch kernel-forkc-export-kernel_thread-to-modules.patch