[PATCH] mm/gup: fix gup_fast with dynamic page table folding

2020-09-11 Thread Vasily Gorbik
Currently to make sure that every page table entry is read just once gup_fast walks perform READ_ONCE and pass pXd value down to the next gup_pXd_range function by value e.g.: static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end, unsigned int flags, st

Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding

2020-09-11 Thread Jason Gunthorpe
On Fri, Sep 11, 2020 at 04:40:00PM -0300, Jason Gunthorpe wrote: > These would probably be better as static inlines though, as only s390 > compiles will type check pudp like this. Never mind, it must be a macro - still need brackets though Jason

Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding

2020-09-11 Thread Jason Gunthorpe
On Fri, Sep 11, 2020 at 09:03:06PM +0200, Vasily Gorbik wrote: > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index e8cbc2e795d5..e899d3506671 100644 > +++ b/include/linux/pgtable.h > @@ -1427,6 +1427,16 @@ typedef unsigned int pgtbl_mod_mask; > #define mm_pmd_folded(mm)__i

Re: [PATCH] mm/gup: fix gup_fast with dynamic page table folding

2020-09-11 Thread Linus Torvalds
On Fri, Sep 11, 2020 at 12:04 PM Vasily Gorbik wrote: > > Currently to make sure that every page table entry is read just once > gup_fast walks perform READ_ONCE and pass pXd value down to the next > gup_pXd_range function by value e.g.: [ ... ] Ack, this looks sane to me. I was going to ask how