From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: + mm-gup-track-foll_pin-pages-fix-2-fix.patch added to -mm tree Date: Thu, 12 Mar 2020 17:32:35 -0700 Message-ID: <20200313003235.RqWdKo3i3%akpm@linux-foundation.org> References: <20200305222751.6d781a3f2802d79510941e4e@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:57140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbgCMAch (ORCPT ); Thu, 12 Mar 2020 20:32:37 -0400 In-Reply-To: <20200305222751.6d781a3f2802d79510941e4e@linux-foundation.org> Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: akpm@linux-foundation.org, imbrenda@linux.ibm.com, jhubbard@nvidia.com, mm-commits@vger.kernel.org, sfr@canb.auug.org.au 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 Subject: mm-gup-track-foll_pin-pages-fix-2-fix fix put_compound_head defined but not used Reported-by: Stephen Rothwell Cc: Claudio Imbrenda Cc: John Hubbard Signed-off-by: Andrew Morton --- 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@linux-foundation.org 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