On Jun 23, 2022, at 2:57 PM, Peter Xu <peterx@xxxxxxxxxx> wrote: > On Wed, Jun 22, 2022 at 11:50:34AM -0700, Nadav Amit wrote: >> @@ -1891,7 +1902,7 @@ static int userfaultfd_continue(struct userfaultfd_ctx *ctx, unsigned long arg) >> if (mmget_not_zero(ctx->mm)) { >> ret = mcopy_continue(ctx->mm, uffdio_continue.range.start, >> uffdio_continue.range.len, >> - &ctx->mmap_changing); >> + &ctx->mmap_changing, 0); > > Shall we consistently use either 0 or UFFD_FLAGS_NONE? I'd go for 0 > directly since that's clearer on having "nothing" as flag. > >> mmput(ctx->mm); >> } else { >> return -ESRCH; > > [...] > >> ssize_t mfill_zeropage(struct mm_struct *dst_mm, unsigned long start, >> - unsigned long len, atomic_t *mmap_changing) >> + unsigned long len, atomic_t *mmap_changing, >> + uffd_flags_t uffd_flags) >> { >> return __mcopy_atomic(dst_mm, start, 0, len, MCOPY_ATOMIC_ZEROPAGE, >> mmap_changing, 0); > > I think you agreed on passing the uffd_flags into __mcopy_atomic() (and > also below). Is it forgotten or plan changed? I addressed these issues in the following patches - I messed up slightly the patch order. I will address these two into patch 1. Regards, Nadav