diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2024-10-10 17:25:37 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-10-23 10:52:49 +0300 |
commit | 0b8b2668f9981c1fefc2ef892bd915288ef01f33 (patch) | |
tree | f6ab4464c0555dbf073d5e65d46a652da5ac9c6e /arch/um/Kconfig | |
parent | 9b0881858c74ae6a1a66de7350d123cf3f83169f (diff) | |
download | linux-0b8b2668f9981c1fefc2ef892bd915288ef01f33.tar.xz |
um: insert scheduler ticks when userspace does not yield
In time-travel mode userspace can do a lot of work without any time
passing. Unfortunately, this can result in OOM situations as the RCU
core code will never be run.
Work around this by keeping track of userspace processes that do not
yield for a lot of operations. When this happens, insert a jiffie into
the sched_clock clock to account time against the process and cause the
bookkeeping to run.
As sched_clock is used for tracing, it is useful to keep it in sync
between the different VMs. As such, try to remove added ticks again when
the actual clock ticks.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20241010142537.1134685-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/Kconfig')
-rw-r--r-- | arch/um/Kconfig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 448454a3d8b5..5dc702ad9e7a 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig @@ -227,6 +227,21 @@ config UML_TIME_TRAVEL_SUPPORT It is safe to say Y, but you probably don't need this. +config UML_MAX_USERSPACE_ITERATIONS + int + prompt "Maximum number of unscheduled userspace iterations" + default 10000 + depends on UML_TIME_TRAVEL_SUPPORT + help + In UML inf-cpu and ext time-travel mode userspace can run without being + interrupted. This will eventually overwhelm the kernel and create OOM + situations (mainly RCU not running). This setting specifies the number + of kernel/userspace switches (minor/major page fault, signal or syscall) + for the same userspace thread before the sched_clock is advanced by a + jiffie to trigger scheduling. + + Setting it to zero disables the feature. + config KASAN_SHADOW_OFFSET hex depends on KASAN |