Re: [PATCH 4/9] userfaultfd/shmem: support UFFDIO_CONTINUE for shmem

2021-04-15 Thread Axel Rasmussen
On Tue, Apr 13, 2021 at 11:12 AM Peter Xu wrote: > > On Mon, Apr 12, 2021 at 09:40:22PM -0700, Axel Rasmussen wrote: > > On Mon, Apr 12, 2021 at 4:17 PM Peter Xu wrote: > > > > > > On Thu, Apr 08, 2021 at 04:43:22PM -0700, Axel Rasmussen wrote: > > > > +/* > > > > + * Install PTEs, to map dst_add

Re: [PATCH 4/9] userfaultfd/shmem: support UFFDIO_CONTINUE for shmem

2021-04-13 Thread Peter Xu
On Mon, Apr 12, 2021 at 09:40:22PM -0700, Axel Rasmussen wrote: > On Mon, Apr 12, 2021 at 4:17 PM Peter Xu wrote: > > > > On Thu, Apr 08, 2021 at 04:43:22PM -0700, Axel Rasmussen wrote: > > > +/* > > > + * Install PTEs, to map dst_addr (within dst_vma) to page. > > > + * > > > + * This function ha

Re: [PATCH 4/9] userfaultfd/shmem: support UFFDIO_CONTINUE for shmem

2021-04-12 Thread Axel Rasmussen
On Mon, Apr 12, 2021 at 4:17 PM Peter Xu wrote: > > On Thu, Apr 08, 2021 at 04:43:22PM -0700, Axel Rasmussen wrote: > > +/* > > + * Install PTEs, to map dst_addr (within dst_vma) to page. > > + * > > + * This function handles MCOPY_ATOMIC_CONTINUE (which is always > > file-backed), > > + * whethe

Re: [PATCH 4/9] userfaultfd/shmem: support UFFDIO_CONTINUE for shmem

2021-04-12 Thread Peter Xu
On Thu, Apr 08, 2021 at 04:43:22PM -0700, Axel Rasmussen wrote: > +/* > + * Install PTEs, to map dst_addr (within dst_vma) to page. > + * > + * This function handles MCOPY_ATOMIC_CONTINUE (which is always file-backed), > + * whether or not dst_vma is VM_SHARED. It also handles the more general > +

[PATCH 4/9] userfaultfd/shmem: support UFFDIO_CONTINUE for shmem

2021-04-08 Thread Axel Rasmussen
With this change, userspace can resolve a minor fault within a shmem-backed area with a UFFDIO_CONTINUE ioctl. The semantics for this match those for hugetlbfs - we look up the existing page in the page cache, and install PTEs for it. This commit introduces a new helper: mcopy_atomic_install_ptes.