Message ID | 20210427225244.4326-1-axelrasmussen@google.com |
---|---|
Headers | show |
Series | userfaultfd: add minor fault handling for shmem | expand |
On Tue, 27 Apr 2021, Axel Rasmussen wrote: > This patch allows shmem-backed VMAs to be registered for minor faults. > Minor faults are appropriately relayed to userspace in the fault path, > for VMAs with the relevant flag. > > This commit doesn't hook up the UFFDIO_CONTINUE ioctl for shmem-backed > minor faults, though, so userspace doesn't yet have a way to resolve > such faults. > > Because of this, we also don't yet advertise this as a supported > feature. That will be done in a separate commit when the feature is > fully implemented. > > Acked-by: Peter Xu <peterx@redhat.com> > Signed-off-by: Axel Rasmussen <axelrasmussen@google.com> Acked-by: Hugh Dickins <hughd@google.com> > --- > fs/userfaultfd.c | 3 +-- > mm/memory.c | 8 +++++--- > mm/shmem.c | 12 +++++++++++- > 3 files changed, 17 insertions(+), 6 deletions(-)
On Tue, Apr 27, 2021 at 03:52:39PM -0700, Axel Rasmussen wrote: > Now that the feature is fully implemented (the faulting path hooks exist > so userspace is notified, and the ioctl to resolve such faults is > available), advertise this as a supported feature. > > Signed-off-by: Axel Rasmussen <axelrasmussen@google.com> Acked-by: Peter Xu <peterx@redhat.com> -- Peter Xu
On Tue, Apr 27, 2021 at 03:52:43PM -0700, Axel Rasmussen wrote: > Currently, the context (fds, mmap-ed areas, etc.) are global. Each test > mutates this state in some way, in some cases really "clobbering it" > (e.g., the events test mremap-ing area_dst over the top of area_src, or > the minor faults tests overwriting the count_verify values in the test > areas). We run the tests in a particular order, each test is careful to > make the right assumptions about its starting state, etc. > > But, this is fragile. It's better for a test's success or failure to not > depend on what some other prior test case did to the global state. > > To that end, clear and reinitialize the test context at the start of > each test case, so whatever prior test cases did doesn't affect future > tests. > > This is particularly relevant to this series because the events test's > mremap of area_dst screws up assumptions the minor fault test was > relying on. This wasn't a problem for hugetlb, as we don't mremap in > that case. > > Signed-off-by: Axel Rasmussen <axelrasmussen@google.com> Reviewed-by: Peter Xu <peterx@redhat.com> -- Peter Xu