Re: [RFC PATCH 1/1] x86/mm/pat: Clear VM_PAT if copy_p4d_range failed
From: Dave Hansen
Date: Wed Feb 22 2023 - 15:04:06 EST
On 2/16/23 18:56, Wupeng Ma wrote:
> dup_mm
> dup_mmap
> copy_page_range
> copy_p4d_range
> copy_pud_range
> copy_pmd_range
> pmd_alloc
> __pmd_alloc
> pmd_alloc_one
> page = alloc_pages(gfp, 0);
> if (!page)
> return NULL;
> mmput
> exit_mmap
> unmap_vmas
> unmap_single_vma
> untrack_pfn
> follow_phys
> WARN_ON_ONCE(1);
What's the point of that warning in the first place? I can certainly
imagine follow_phys() failing for sparse mappings, for instance. Is
there some requirement that VM_PFNMAP can't be sparse?