lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <da582eb3-1682-4eb5-869d-f984a484e385@nvidia.com>
Date: Mon, 22 Apr 2024 12:36:47 -0700
From: John Hubbard <jhubbard@...dia.com>
To: David Hildenbrand <david@...hat.com>, <linux-kernel@...r.kernel.org>
CC: <linux-mm@...ck.org>, Zi Yan <ziy@...dia.com>, Matthew Wilcox
	<willy@...radead.org>, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v1] mm/huge_memory: improve
 split_huge_page_to_list_to_order() return value documentation

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@...dia.com>

thanks,
-- 
John Hubbard
NVIDIA


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ