Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-12 Thread Peter Xu
On Mon, Apr 12, 2021 at 05:51:14PM -0700, Hugh Dickins wrote: > On Mon, 12 Apr 2021, Peter Xu wrote: > > On Tue, Apr 06, 2021 at 11:14:30PM -0700, Hugh Dickins wrote: > > > > +static int mcopy_atomic_install_ptes(struct mm_struct *dst_mm, pmd_t > > > > *dst_pmd, > > > > +

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-12 Thread Hugh Dickins
On Mon, 12 Apr 2021, Peter Xu wrote: > On Tue, Apr 06, 2021 at 11:14:30PM -0700, Hugh Dickins wrote: > > > +static int mcopy_atomic_install_ptes(struct mm_struct *dst_mm, pmd_t > > > *dst_pmd, > > > + struct vm_area_struct *dst_vma, > > > +

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-12 Thread Peter Xu
Hi, Hugh, On Tue, Apr 06, 2021 at 11:14:30PM -0700, Hugh Dickins wrote: > > +static int mcopy_atomic_install_ptes(struct mm_struct *dst_mm, pmd_t > > *dst_pmd, > > +struct vm_area_struct *dst_vma, > > +unsigned long dst_addr, struct

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-07 Thread Hugh Dickins
On Wed, 7 Apr 2021, Axel Rasmussen wrote: > Agreed about taking one direction or the other further. > > I get the sense that Peter prefers the mcopy_atomic_install_ptes() > version, and would thus prefer to just expose that and let > shmem_mcopy_atomic_pte() use it. > > But, I get the sense that

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-07 Thread Axel Rasmussen
Thanks for the thorough and insightful review, Hugh! On Tue, Apr 6, 2021 at 11:14 PM Hugh Dickins wrote: > > [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior > was a significant rework, so here I'm reviewing a synthetic patch > merged from 5.12-rc5's 20

Re: [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-06 Thread Hugh Dickins
[PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior was a significant rework, so here I'm reviewing a synthetic patch merged from 5.12-rc5's 2021-03-31 mmotm patches: userfaultfd-support-minor-fault-handling-for-shmem.patch userfaultfd-support-minor-fault-handling

[PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior

2021-04-01 Thread Axel Rasmussen
Previously, the continue implementation in shmem_mcopy_atomic_pte was incorrect for two main reasons: - It didn't correctly skip some sections of code which make sense for newly allocated pages, but absolutely don't make sense for pre-existing page cache pages. - Because shmem_mcopy_continue_