Re: [PATCH v3] mm/memory: update stale locking comments for fault handlers
From: Aditya Sharma
Date: Fri Apr 24 2026 - 05:12:36 EST
From: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Date: Fri, 24 Apr 2026 13:37:01 +0530
> > /*
> > - * We enter with non-exclusive mmap_lock (to exclude vma changes,
> > - * but allow concurrent faults), and pte mapped but not yet locked.
> > + * We enter with either the VMA lock or the mmap_lock held (see
> > + * FAULT_FLAG_VMA_LOCK), and pte mapped but not yet locked.
> > * We return with pte unmapped and unlocked.
> > *
> > - * We return with the mmap_lock locked or unlocked in the same cases
> > + * We return with the lock locked or unlocked in the same cases
> > * as does filemap_fault().
>
> Maybe phrase the second part similar to the other statements further below:
>
> "When returning, the lock may have been released in the same cases as done by
> filemap_fault()".
Okay, will do in v4
> > /*
> > - * The mmap_lock must have been held on entry, and may have been
> > - * released depending on flags and vma->vm_ops->fault() return value.
> > - * See filemap_fault() and __lock_page_retry().
> > + * Either the VMA lock or the mmap_lock must have been held on entry,
>
> Do we want to also add a "see .." here?
Will do in v4
> In general LGTM!
Thanks, will send a v4 shortly
Aditya