ANDROID: userfaultfd: allow SPF for UFFD_FEATURE_SIGBUS on private+anon
Currently we bail out of speculative page fault when we detect that the fault address is in a userfaultfd registered vma. However, if userfaultfd is being used with UFFD_FEATURE_SIGBUS feature, then handle_userfault() doesn't do much and is easiest to handle with SPF. This patch lets MISSING userfaultfs on private anonymous mappings be allowed with SPF if UFFD_FEATURE_SIGBUS is used. With this patch we get >99% success rate for userfaults caused during userfaultfd GC's compaction phase. This translates into eliminating uninterruptible sleep time in do_page_fault() due to userfaults. Bug: 320478828 Bug: 328786602 Signed-off-by:Lokesh Gidra <lokeshgidra@google.com> Change-Id: Ic7fde0fde03602b35179bc0cf891ddbbc434190f (cherry picked from commit 582c6d18)
Showing
- fs/userfaultfd.c 71 additions, 25 deletionsfs/userfaultfd.c
- include/linux/mm_types.h 1 addition, 1 deletioninclude/linux/mm_types.h
- include/linux/userfaultfd_k.h 11 additions, 1 deletioninclude/linux/userfaultfd_k.h
- mm/memory.c 27 additions, 7 deletionsmm/memory.c
- mm/userfaultfd.c 1 addition, 1 deletionmm/userfaultfd.c
Loading
Please register or sign in to comment