Thread (25 messages) 25 messages, 2 authors, 2021-01-19

Re: [PATCH v5 08/14] mm/gup: do not allow zero page for pinned pages

From: Pavel Tatashin <pasha.tatashin@soleen.com>
Date: 2021-01-19 20:17:00
Also in: linux-kselftest, linux-mm, lkml

On Tue, Jan 19, 2021 at 1:47 PM Jason Gunthorpe [off-list ref] wrote:
On Tue, Jan 19, 2021 at 01:34:26PM -0500, Pavel Tatashin wrote:
quoted
On Tue, Jan 19, 2021 at 1:30 PM Jason Gunthorpe [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 11:39:14PM -0500, Pavel Tatashin wrote:
quoted
Zero page should not be used for long term pinned pages. Once pages
are pinned their physical addresses cannot changed until they are unpinned.

Guarantee to always return real pages when they are pinned by adding
FOLL_WRITE.

Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
 mm/gup.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
No, this will definitely break things
What will break
Things assuming GUP doesn't break COW, making all GUP WRITE was
already tried and revered for some other reason
quoted
quoted
Why does the zero page have to be movable?
It is not even about being movable, we can't cow pinned pages returned
by GUP call, how can we use zero page for that?
The zero page is always zero, it is never written to. What does cow
matter?
Hi Jason,

I was thinking about a use case where userland would pin an address
without FOLL_WRITE, because the PTE for that address is not going to
be writable, but some device via DMA will write to it. Now, if we got
a zero page we have a problem... If this usecase is not valid then the
fix for movable zero page is make the zero page always come from a
non-movable zone so we do not need to isolate it during migration, and
so the memory can be offlined later.

Pasha
Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help