lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm: Don't fault around userfaultfd-registered regions on reads
On Tue, 1 Dec 2020, Andrea Arcangeli wrote:
>
> Any suggestions on how to have the per-vaddr per-mm _PAGE_UFFD_WP bit
> survive the pte invalidates in a way that remains associated to a
> certain vaddr in a single mm (so it can shoot itself in the foot if it
> wants, but it can't interfere with all other mm sharing the shmem
> file) would be welcome...

I think it has to be a new variety of swap-like non_swap_entry() pte,
see include/linux/swapops.h. Anything else would be more troublesome.

Search for non_swap_entry and for migration_entry, to find places that
might need to learn about this new variety.

IIUC you only need a single value, no need to carve out another whole
swp_type: could probably be swp_offset 0 of any swp_type other than 0.

Note that fork's copy_page_range() does not "copy ptes where a page
fault will fill them correctly", so would in effect put a pte_none
into the child where the parent has this uffd_wp entry. I don't know
anything about uffd versus fork, whether that would pose a problem.

Hugh

\
 
 \ /
  Last update: 2020-12-02 23:47    [W:0.143 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site