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

- From: David Hildenbrand \<hidden\>
- Date: 2021-12-19 17:44:19 
- List: linux-doc
- Page: https://ratatoskr.run/linux-doc/2021/12/1613458
- Thread: https://ratatoskr.run/linux-mm/2021/12/1612167/t/2.md

```text
> 
> Btw, the extra bit doesn't really have to be in the page tables. It
> could be a bit in the page itself. We could add another page bit that
> we just clear when we do the "add ref to page as you make a virtual
> copy during fork() etc".

^ I'm playing with the idea if using a page bit to express: "This page
is exclusive". On a CoW fault, if that bit is set, I can simply reuse
the page.

The semantics under which semantics to set the bit are slightly
different than what you describe, and I'm playing with additional
unsharing (on GUP R/O) that avoids mapping the copied page similarly R/O
and simply sets the bit.

But the general idea could fly I think, devil's in the detail ...

-- 
Thanks,

David / dhildenb

```
