Thread (62 messages) 62 messages, 11 authors, 2020-09-15

Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2020-09-10 23:21:21
Also in: linux-arch, linux-mm, linux-s390, linux-um, linuxppc-dev, lkml, sparclinux

On Thu, Sep 10, 2020 at 07:57:49PM +0200, Gerald Schaefer wrote:
On Thu, 10 Sep 2020 10:02:33 -0300
Jason Gunthorpe [off-list ref] wrote:
quoted
On Thu, Sep 10, 2020 at 11:39:25AM +0200, Alexander Gordeev wrote:
quoted
As Gerald mentioned, it is very difficult to explain in a clear way.
Hopefully, one could make sense ot of it.
I would say the page table API requires this invariant:

        pud = pud_offset(p4d, addr);
        do {
		WARN_ON(pud != pud_offset(p4d, addr);
                next = pud_addr_end(addr, end);
        } while (pud++, addr = next, addr != end);

ie pud++ is supposed to be a shortcut for 
  pud_offset(p4d, next)
Hmm, IIUC, all architectures with static folding will simply return
the passed-in p4d pointer for pud_offset(p4d, addr), for 3-level
pagetables.
It is probably moot now, but since other arch's don't crash they also
return pud_addr_end() == end so the loop only does one iteration.

ie pud == pud_offset(p4d, addr) for all iterations as the pud++ never
happens.

Which is what this addr_end patch does for s390..

Jason

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help