Re: [PATCH v4] mm/memory: update stale locking comments for fault handlers
From: David Hildenbrand (Arm)
Date: Tue Apr 28 2026 - 15:48:57 EST
On 4/24/26 11:22, Aditya Sharma wrote:
> Update the comments for wp_page_copy(), do_wp_page(), do_swap_page(),
> do_anonymous_page(), __do_fault(), do_fault(), handle_pte_fault(),
> __handle_mm_fault(), and handle_mm_fault() to concisely clarify that
> they can be entered holding either the mmap_lock or the VMA lock,
> and that the lock may be released upon returning VM_FAULT_RETRY.
>
> Additionally, make the following corrections:
> - In do_anonymous_page(), correct the outdated claim that the function
> is entered with the PTE "mapped but not yet locked". Since
> handle_pte_fault() unmaps the empty PTE before routing to
> do_pte_missing(), the comment now correctly states it is entered
> with the PTE unmapped and unlocked.
Yes, that is correct.
> - In __do_fault(), update the stale reference from __lock_page_retry()
> to __folio_lock_or_retry().
That as well.
>
> Signed-off-by: Aditya Sharma <adi.sharma@xxxxxxxxxxx>
> ---
Thanks!
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David