On Tue, Jul 11, 2023 at 10:20 PM Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> wrote: > Call do_pte_missing() under the VMA lock ... then immediately retry > in do_fault(). > > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> > --- [...] > @@ -4961,6 +4961,11 @@ static vm_fault_t handle_pte_fault(struct vm_fault *vmf) > if (!vmf->pte) > return do_pte_missing(vmf); > > + if ((vmf->flags & FAULT_FLAG_VMA_LOCK) && !vma_is_anonymous(vmf->vma)) { > + vma_end_read(vmf->vma); > + return VM_FAULT_RETRY; > + } At this point we can have vmf->pte mapped, right? Does this mean this bailout leaks a kmap_local() on CONFIG_HIGHPTE? > if (!pte_present(vmf->orig_pte)) > return do_swap_page(vmf);