Re: [PATCH] mm/gup: Allow real explicit breaking of COW

From: Peter Xu
Date: Mon Aug 10 2020 - 10:53:12 EST


On Mon, Aug 10, 2020 at 02:24:19PM +0200, Christoph Hellwig wrote:
> This patch only seems to add a flag, but no actual user of it.

Oops, right.. I'll repost with below squashed into it:

diff --git a/mm/gup.c b/mm/gup.c
index 6f47697f8fb0..9d1f44b01165 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -870,6 +870,8 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
return -ENOENT;
if (*flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
+ if (*flags & FOLL_BREAK_COW)
+ fault_flags |= FAULT_FLAG_BREAK_COW;
if (*flags & FOLL_REMOTE)
fault_flags |= FAULT_FLAG_REMOTE;
if (locked)

Thanks,

--
Peter Xu