FROMLIST: mm: introduce CONFIG_SPECULATIVE_PAGE_FAULT

This configuration variable will be used to build the code needed to
handle speculative page fault.

This is enabled by default on supported architectures with SMP and MMU set.

The architecture support is needed since the speculative page fault handler
is called from the architecture's page faulting code, and some code has to
be added there to try speculative fault handling first.

Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
Link: https://lore.kernel.org/all/20220128131006.67712-7-michel@lespinasse.org/
Bug: 161210518
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ie1dc3af30bf3949173b126e6469f372c4505ec8e
This commit is contained in:
Michel Lespinasse
2022-01-24 17:43:54 -08:00
committed by Todd Kjos
parent 57f3bb2b12
commit 67ad4ad4de

View File

@@ -918,4 +918,26 @@ config ANON_VMA_NAME
source "mm/damon/Kconfig"
config ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT
def_bool n
config SPECULATIVE_PAGE_FAULT
bool "Speculative page faults"
default y
depends on ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT && MMU && SMP
help
Try to handle user space page faults without holding the mmap lock.
Instead of blocking writers through the use of mmap lock,
the page fault handler merely verifies, at the end of the page
fault, that no writers have been running concurrently with it.
In high concurrency situations, the speculative fault handler
gains a throughput advantage by avoiding having to update the
mmap lock reader count.
If the check fails due to a concurrent writer, or due to hitting
an unsupported case, the fault handler falls back to classical
processing using the mmap read lock.
endmenu