On Tue, Oct 3, 2017 at 1:09 AM, Jan Kara <jack@xxxxxxx> wrote: > On Thu 28-09-17 18:21:18, Dan Williams wrote: >> VM_MIXEDMAP is used by dax to direct mm paths like vm_normal_page() that >> the memory page it is dealing with is not typical memory from the linear >> map. The get_user_pages_fast() path, since it does not resolve the vma, >> is already using {pte,pmd}_devmap() as a stand-in for VM_MIXEDMAP, so we >> use that as a VM_MIXEDMAP replacement in some locations. In the cases >> where there is no pte to consult we fallback to using vma_is_dax() to >> detect the VM_MIXEDMAP special case. > > Well, I somewhat dislike the vma_is_dax() checks sprinkled around. That > seems rather errorprone (easy to forget about it when adding new check > somewhere). Can we possibly also create a helper vma_is_special() (or some > other name) which would do ((vma->vm_flags & VM_SPECIAL) || vma_is_dax(vma) > || is_vm_hugetlb_page(vma)) and then use it in all those places? Yes, I can take a look at that... I shied away from it initially since it does not appear that "vma_is_special()" paths are symmetric in terms of all the conditions they check, but perhaps I can start small with the ones that are common. I'll break that conversion out into a lead-in cleanup patch.