Thread (9 messages) flat view 9 messages, 2 authors, 2021-02-09

Re: [PATCH v4 5/5] hugetlb: Do early cow when page pinned on src mm

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2021-02-09 19:14:42
Also in: lkml

On Mon, Feb 08, 2021 at 10:02:29PM -0500, Peter Xu wrote:
This is the last missing piece of the COW-during-fork effort when there're
pinned pages found.  One can reference 70e806e4e645 ("mm: Do early cow for
pinned pages during fork() for ptes", 2020-09-27) for more information, since
we do similar things here rather than pte this time, but just for hugetlb.

Note that after Jason's recent work on 57efa1fe5957 ("mm/gup: prevent gup_fast
from racing with COW during fork", 2020-12-15) which is safer and easier to
understand, we're safe now within the whole copy_page_range() against gup-fast,
we don't need the wr-protect trick that proposed in 70e806e4e645 anymore.

Reviewed-by: Mike Kravetz <redacted>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 mm/hugetlb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 62 insertions(+), 4 deletions(-)
Didn't check every hugetlbfs detail, but looks reasonable

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

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