From: Steven Sistare <steven.sistare@oracle.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: iommu@lists.linux.dev, Kevin Tian <kevin.tian@intel.com>,
Nicolin Chen <nicolinc@nvidia.com>,
David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [PATCH V1 1/9] mm/gup: repin_folio_unhugely
Date: Wed, 18 Sep 2024 10:51:11 -0400 [thread overview]
Message-ID: <204fd4a6-6461-40ab-bcb4-066dbf087232@oracle.com> (raw)
In-Reply-To: <ZudFcANtENlaRJ+r@nvidia.com>
On 9/15/2024 4:37 PM, Jason Gunthorpe wrote:
> On Sat, Sep 14, 2024 at 06:05:50AM -0700, Steve Sistare wrote:
>> diff --git a/mm/gup.c b/mm/gup.c
>> index 947881ff..f8f3f2a 100644
>> --- a/mm/gup.c
>> +++ b/mm/gup.c
>> @@ -3720,3 +3720,21 @@ long memfd_pin_folios(struct file *memfd, loff_t start, loff_t end,
>> return ret;
>> }
>> EXPORT_SYMBOL_GPL(memfd_pin_folios);
>> +
>> +/**
>> + * repin_folio_unhugely() - repin a folio at small page granularity
>> + * @folio: the folio to repin
>> + * @npin: the number of pages pinned in the folio
>> + *
>> + * Given a huge page folio that is already pinned, and the number of small
>> + * pages that are pinned in it, adjust the pincount to reflect small-page
>> + * granularity. Each small page can later be unpinned individually.
>> + */
>
> I think the language choice here is probably not entirely consistent
> with the rest of the code
Yes, a good name was not obvious to me, to I submitted a slightly flippant
name to generate some discussion :)
>
> Maybe
>
> folio_split_user_page_pin(folio, npages)
> @npages: The new number of pages the folio pin reference should hold
>
> Given a high order folio that is already pinned adjust the reference
> count to allow unpin_user_page_range() and related to be called on a
> the folio. npages is the number of pages that will be passed to a
> future unpin_user_page_range().
>
> Which anchors it in the purpose a little more
Thanks, I will use this if no one objects.
- Steve
> The implementation looked OK to me
>
> Jason
prev parent reply other threads:[~2024-09-18 14:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1726319158-283074-1-git-send-email-steven.sistare@oracle.com>
[not found] ` <1726319158-283074-2-git-send-email-steven.sistare@oracle.com>
2024-09-14 13:19 ` Steven Sistare
2024-09-17 12:25 ` David Hildenbrand
2024-09-18 14:51 ` Steven Sistare
2024-09-19 8:11 ` David Hildenbrand
2024-09-19 21:06 ` Steven Sistare
2024-09-26 11:38 ` David Hildenbrand
2024-09-20 13:28 ` Jason Gunthorpe
2024-09-26 11:32 ` David Hildenbrand
2024-09-26 11:40 ` Jason Gunthorpe
2024-09-26 12:57 ` David Hildenbrand
2024-09-26 12:58 ` David Hildenbrand
[not found] ` <ZudFcANtENlaRJ+r@nvidia.com>
2024-09-18 14:51 ` Steven Sistare [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=204fd4a6-6461-40ab-bcb4-066dbf087232@oracle.com \
--to=steven.sistare@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=linux-mm@kvack.org \
--cc=nicolinc@nvidia.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