On Wed, Oct 15, 2025 at 05:30:07PM +0200, Loïc Molinari wrote:
This looks fine, no need to resend to fix this, but if you'd written
the previous patch slightly differently, you'd've reduced the amount of
code you moved around in this patch, which would have made it easier to
review.
> + /* Map a range of pages around the faulty address. */
> + do {
> + pfn = page_to_pfn(pages[start_pgoff]);
> + ret = vmf_insert_pfn(vma, addr, pfn);
> + addr += PAGE_SIZE;
> + } while (++start_pgoff <= end_pgoff && ret == VM_FAULT_NOPAGE);
It looks to me like we have an opportunity to do better here by
adding a vmf_insert_pfns() interface. I don't think we should delay
your patch series to add it, but let's not forget to do that; it can
have very good performnce effects on ARM to use contptes.
> @@ -617,8 +645,9 @@ static vm_fault_t drm_gem_shmem_fault(struct vm_fault
> *vmf)
[...]
>
> - ret = vmf_insert_pfn(vma, vmf->address, page_to_pfn(page));
> + if (drm_gem_shmem_map_pmd(vmf, vmf->address, pages[page_offset])) {
> + ret = VM_FAULT_NOPAGE;
> + goto out;
> }
Does this actually work?