# Re: \[PATCH v1 06/11\] mm: support GUP-triggered unsharing via FAULT\_FLAG\_UNSHARE (!hugetlb)

- From: Jason Gunthorpe \<jgg@nvidia.com\>
- Date: 2021-12-18 00:50:46 
- List: linux-doc
- Page: https://ratatoskr.run/linux-doc/2021/12/1612959
- Thread: https://ratatoskr.run/linux-mm/2021/12/1612167/t.md

```text
On Fri, Dec 17, 2021 at 09:15:45PM +0000, Nadav Amit wrote:

> I think that there is an assumption that once a page is COW-broken,
> it would never have another write-fault that might lead to COW
> breaking later.

Yes, that is what Linus has been explaining, AFAICT

> AFAIK at least after userfaultfd-WP followed by
> userfaultfd-write-unprotect a page might be write-protected and
> go through do_wp_page() a second time to be COW-broken again. In
> such case, I think the FOLL_FORCE|FOLL_WRITE would not help.

Right, and this is a good reason why refcount is running into trouble,
it COW's too much in cases like that because userfaultfd-WP doesn't
align to the first assumption.

Jason
```
