From: John Hubbard <jhubbard@nvidia.com>
To: David Hildenbrand <david@redhat.com>, <linux-kernel@vger.kernel.org>
Cc: <linux-mm@kvack.org>, Zi Yan <ziy@nvidia.com>,
Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v1] mm/huge_memory: improve split_huge_page_to_list_to_order() return value documentation
Date: Mon, 22 Apr 2024 12:36:47 -0700 [thread overview]
Message-ID: <da582eb3-1682-4eb5-869d-f984a484e385@nvidia.com> (raw)
In-Reply-To: <d97f8fdc-eb38-485e-81e2-51f748089939@redhat.com>
On 4/22/24 12:31 PM, David Hildenbrand wrote:
> On 19.04.24 02:15, John Hubbard wrote:
>> On 4/18/24 8:18 AM, David Hildenbrand wrote:
...
>>> *
>>> * Returns 0 if the huge page was split successfully.
>>> *
>>> - * Returns -EBUSY if @page's folio is pinned, or if the anon_vma disappeared
>>> - * from under us.
>>> + * Returns -EAGAIN if the folio has unexpected reference (e.g., GUP).
>>
>> ...or if the folio was removed from the page cache before this routine
>> got a chance to lock it, right? (See the "fail:" path.)
>
> Right, that is sneaky. Let me extend to cover that case as well.
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 824eff9211db8..a7406267323ed 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2975,7 +2975,8 @@ bool can_split_folio(struct folio *folio, int *pextra_pins)
> *
> * Returns 0 if the huge page was split successfully.
> *
> - * Returns -EAGAIN if the folio has unexpected reference (e.g., GUP).
> + * Returns -EAGAIN if the folio has unexpected reference (e.g., GUP) or if
> + * the folio was concurrently removed from the page cache.
Looks good,
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2024-04-22 19:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 15:18 David Hildenbrand
2024-04-19 0:15 ` John Hubbard
2024-04-22 19:31 ` David Hildenbrand
2024-04-22 19:36 ` John Hubbard [this message]
2024-04-22 14:21 ` Zi Yan
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=da582eb3-1682-4eb5-869d-f984a484e385@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
--cc=ziy@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