On Fri, Nov 08, 2019 at 09:01:43PM +0800, Li Xinhai wrote: > Checking unmapped hole and updating the previous vma must be handled first, > otherwise the unmapped hole could be calculated from a wrong previous vma. > > Several commits were relevant to this error: > commit 6f4576e3687b > ("mempolicy: apply page table walker on queue_pages_range()"), > This commit was correct, the VM_PFNMAP check was after updateing previous > vma > > commit 48684a65b4e3 > (mm: pagewalk: fix misbehavior of walk_page_range for vma(VM_PFNMAP)), > This commit added VM_PFNMAP check before updateing previous vma. Then, > there were two VM_PFNMAP check did same thing twice. > > commit acda0c334028 > (mm/mempolicy.c: get rid of duplicated check for vma(VM_PFNMAP) in queue_page > s_range()), > This commit tried to fix the duplicated VM_PFNMAP check, but it wrongly > removed the one which was after updateing vma. > > Fixes: acda0c334028 (mm/mempolicy.c: get rid of duplicated check for vma(VM_PFNMAP) in queue_page > s_range()) > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Cc: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> > Cc: Michal Hocko <mhocko@xxxxxxxx> > Cc: Vlastimil Babka <vbabka@xxxxxxx> > Cc: Hugh Dickins <hughd@xxxxxxxxxx> > Cc: linux-man <linux-man@xxxxxxxxxxxxxxx> > Signed-off-by: Li Xinhai <lixinhai.lxh@xxxxxxxxx> Reviewed-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>