Re: [PATCH v7 4/6] userfaultfd: add UFFDIO_CONTINUE ioctl

2021-02-23 Thread Peter Xu
On Tue, Feb 23, 2021 at 10:05:49AM -0800, Axel Rasmussen wrote: > On Tue, Feb 23, 2021 at 7:38 AM Peter Xu wrote: > > > > On Thu, Feb 18, 2021 at 04:48:22PM -0800, Axel Rasmussen wrote: > > > @@ -4645,8 +4646,18 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct > > > *dst_mm, > > >

Re: [PATCH v7 4/6] userfaultfd: add UFFDIO_CONTINUE ioctl

2021-02-23 Thread Axel Rasmussen
On Tue, Feb 23, 2021 at 7:38 AM Peter Xu wrote: > > On Thu, Feb 18, 2021 at 04:48:22PM -0800, Axel Rasmussen wrote: > > @@ -4645,8 +4646,18 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct > > *dst_mm, > > spinlock_t *ptl; > > int ret; > > struct page *page; > > + int

Re: [PATCH v7 4/6] userfaultfd: add UFFDIO_CONTINUE ioctl

2021-02-23 Thread Peter Xu
On Thu, Feb 18, 2021 at 04:48:22PM -0800, Axel Rasmussen wrote: > @@ -4645,8 +4646,18 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, > spinlock_t *ptl; > int ret; > struct page *page; > + int writable; > > - if (!*pagep) { > + mapping =

[PATCH v7 4/6] userfaultfd: add UFFDIO_CONTINUE ioctl

2021-02-18 Thread Axel Rasmussen
This ioctl is how userspace ought to resolve "minor" userfaults. The idea is, userspace is notified that a minor fault has occurred. It might change the contents of the page using its second non-UFFD mapping, or not. Then, it calls UFFDIO_CONTINUE to tell the kernel "I have ensured the page