From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: RE: [PATCH 2/2] mm/gup: Remove page_folio() in memfd_pin_folios()
Date: Thu, 1 May 2025 21:23:46 +0000 [thread overview]
Message-ID: <IA0PR11MB71854F7F2A30A7004FA28D5BF8822@IA0PR11MB7185.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20250430010059.892632-3-vishal.moola@gmail.com>
Hi Vishal,
> Subject: [PATCH 2/2] mm/gup: Remove page_folio() in memfd_pin_folios()
>
> We can get the folio directly from the folio batch, so remove the
> unnecessary page_folio() call.
>
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> ---
> mm/gup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index 1fb8f3b9a493..795fd94f379d 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -3640,7 +3640,7 @@ long memfd_pin_folios(struct file *memfd, loff_t
> start, loff_t end,
> }
>
> for (i = 0; i < nr_found; i++) {
> - folio = page_folio(&fbatch.folios[i]->page);
> + folio = fbatch.folios[i];
I don't recall why I chose to extract the folio in a roundabout way. LGTM.
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Thanks,
Vivek
>
> if (try_grab_folio(folio, 1, FOLL_PIN)) {
> folio_batch_release(&fbatch);
> --
> 2.49.0
prev parent reply other threads:[~2025-05-01 21:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 1:00 [PATCH 0/2] mm/gup: Cleanup memfd_pin_folios() Vishal Moola (Oracle)
2025-04-30 1:00 ` [PATCH 1/2] mm/gup: Remove unnecessary check in memfd_pin_folios() Vishal Moola (Oracle)
2025-04-30 21:48 ` David Hildenbrand
2025-05-01 21:23 ` Kasireddy, Vivek
2025-04-30 1:00 ` [PATCH 2/2] mm/gup: Remove page_folio() " Vishal Moola (Oracle)
2025-04-30 21:49 ` David Hildenbrand
2025-05-01 21:23 ` Kasireddy, Vivek [this message]
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=IA0PR11MB71854F7F2A30A7004FA28D5BF8822@IA0PR11MB7185.namprd11.prod.outlook.com \
--to=vivek.kasireddy@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=vishal.moola@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