From: John Hubbard <jhubbard@nvidia.com>
To: Yang Shi <shy828301@gmail.com>, <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: gup: remove FOLL_SPLIT
Date: Tue, 30 Mar 2021 00:08:34 -0700 [thread overview]
Message-ID: <624d1172-cdf9-ce82-aa0b-6646f3bee757@nvidia.com> (raw)
In-Reply-To: <20210329193828.179993-1-shy828301@gmail.com>
On 3/29/21 12:38 PM, Yang Shi wrote:
> Since commit 5a52c9df62b4 ("uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT")
> and commit ba925fa35057 ("s390/gmap: improve THP splitting") FOLL_SPLIT
> has not been used anymore. Remove the dead code.
>
> Signed-off-by: Yang Shi <shy828301@gmail.com>
> ---
> include/linux/mm.h | 1 -
> mm/gup.c | 28 ++--------------------------
> 2 files changed, 2 insertions(+), 27 deletions(-)
>
Looks nice.
As long as I'm running git grep here, there is one more search hit that should also
be fixed up, as part of a "remove FOLL_SPLIT" patch:
git grep -nw FOLL_SPLIT
Documentation/vm/transhuge.rst:57:follow_page, the FOLL_SPLIT bit can be specified as a parameter to
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
thanks,
--
John Hubbard
NVIDIA
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 8ba434287387..3568836841f9 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2780,7 +2780,6 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
> #define FOLL_NOWAIT 0x20 /* if a disk transfer is needed, start the IO
> * and return without waiting upon it */
> #define FOLL_POPULATE 0x40 /* fault in page */
> -#define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */
> #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */
> #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */
> #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */
> diff --git a/mm/gup.c b/mm/gup.c
> index e40579624f10..f3d45a8f18ae 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -435,18 +435,6 @@ static struct page *follow_page_pte(struct vm_area_struct *vma,
> }
> }
>
> - if (flags & FOLL_SPLIT && PageTransCompound(page)) {
> - get_page(page);
> - pte_unmap_unlock(ptep, ptl);
> - lock_page(page);
> - ret = split_huge_page(page);
> - unlock_page(page);
> - put_page(page);
> - if (ret)
> - return ERR_PTR(ret);
> - goto retry;
> - }
> -
> /* try_grab_page() does nothing unless FOLL_GET or FOLL_PIN is set. */
> if (unlikely(!try_grab_page(page, flags))) {
> page = ERR_PTR(-ENOMEM);
> @@ -591,7 +579,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma,
> spin_unlock(ptl);
> return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap);
> }
> - if (flags & (FOLL_SPLIT | FOLL_SPLIT_PMD)) {
> + if (flags & FOLL_SPLIT_PMD) {
> int ret;
> page = pmd_page(*pmd);
> if (is_huge_zero_page(page)) {
> @@ -600,19 +588,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma,
> split_huge_pmd(vma, pmd, address);
> if (pmd_trans_unstable(pmd))
> ret = -EBUSY;
> - } else if (flags & FOLL_SPLIT) {
> - if (unlikely(!try_get_page(page))) {
> - spin_unlock(ptl);
> - return ERR_PTR(-ENOMEM);
> - }
> - spin_unlock(ptl);
> - lock_page(page);
> - ret = split_huge_page(page);
> - unlock_page(page);
> - put_page(page);
> - if (pmd_none(*pmd))
> - return no_page_table(vma, flags);
> - } else { /* flags & FOLL_SPLIT_PMD */
> + } else {
> spin_unlock(ptl);
> split_huge_pmd(vma, pmd, address);
> ret = pte_alloc(mm, pmd) ? -ENOMEM : 0;
>
next prev parent reply other threads:[~2021-03-30 7:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 19:38 Yang Shi
2021-03-30 6:24 ` kernel test robot
2021-03-30 7:08 ` John Hubbard
2021-04-09 8:44 ` [kbuild-all] " Rong Chen
2021-03-30 7:08 ` John Hubbard [this message]
2021-03-30 16:34 ` Yang Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=624d1172-cdf9-ce82-aa0b-6646f3bee757@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox