userfaultfd: hugetlbfs: gup: support VM_FAULT_RETRY
Subsystems (3)
[email protected]
maintainerPATCH 69/142 userfaultfd: hugetlbfs: gup: support VM_FAULT_RETRY
From: Andrea Arcangeli <[email protected]>
Subject: userfaultfd: hugetlbfs: gup: support VM_FAULT_RETRY
Add support for VM_FAULT_RETRY to follow_hugetlb_page() so that get_user_pages_unlocked/locked and "nonblocking/FOLL_NOWAIT" features will work on hugetlbfs. This is required for fully functional userfaultfd non-present support on hugetlbfs.
Signed-off-by Andrea Arcangeli <[email protected]>
Reviewed-by Mike Kravetz <[email protected]>
Cc "Dr. David Alan Gilbert" <[email protected]>
Cc Hillf Danton <[email protected]>
Cc Michael Rapoport <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Pavel Emelyanov <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
include/linux/hugetlb.h | 5 ++- mm/gup.c | 2 - mm/hugetlb.c | 48 +++++++++++++++++++++++++++++++------- 3 files changed, 44 insertions(+), 11 deletions(-)
include/linux/hugetlb.h renamed from include/linux/hugetlb.h~userfaultfd-hugetlbfs-gup-support-vm_fault_retry +3 -2
@@ -65,7 +65,8 @@ int hugetlb_mempolicy_sysctl_handler(strint copy_hugetlb_page_range (struct mm_struct *,struct mm_struct *,struct vm_area_struct *);long follow_hugetlb_page (struct mm_struct *,struct vm_area_struct *,struct page **,struct vm_area_struct **, -unsigned long *,unsigned long *,long ,unsigned int ); +unsigned long *,unsigned long *,long ,unsigned int , +int *);void unmap_hugepage_range (struct vm_area_struct *,unsigned long ,unsigned long ,struct page *); void __unmap_hugepage_range_final(struct mmu_gather *tlb,
@@ -136,7 +137,7 @@ static inline unsigned long hugetlb_totareturn 0 ; } -#define follow_hugetlb_page (m,v,p,vs,a,b,i,w) ({ BUG(); 0; }) +#define follow_hugetlb_page (m,v,p,vs,a,b,i,w,n) ({ BUG(); 0; })#define follow_huge_addr (mm, addr, write) ERR_PTR(-EINVAL)#define copy_hugetlb_page_range (src, dst, vma) ({ BUG(); 0; })static inline void hugetlb_report_meminfo (struct seq_file *m)
mm/gup.c renamed from mm/gup.c~userfaultfd-hugetlbfs-gup-support-vm_fault_retry +1 -1
@@ -572,7 +572,7 @@ static long __get_user_pages(struct taskif (is_vm_hugetlb_page (vma)) { i =follow_hugetlb_page (mm, vma, pages, vmas, &start, &nr_pages, i, - gup_flags); + gup_flags, nonblocking);continue ; } }
mm/hugetlb.c renamed from mm/hugetlb.c~userfaultfd-hugetlbfs-gup-support-vm_fault_retry +40 -8
69 lines not on this page · raw message
_