]> www.infradead.org Git - users/dwmw2/linux.git/commit
um: insert scheduler ticks when userspace does not yield
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 10 Oct 2024 14:25:37 +0000 (16:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Oct 2024 07:52:49 +0000 (09:52 +0200)
commit0b8b2668f9981c1fefc2ef892bd915288ef01f33
treef6ab4464c0555dbf073d5e65d46a652da5ac9c6e
parent9b0881858c74ae6a1a66de7350d123cf3f83169f
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>
arch/um/Kconfig
arch/um/include/shared/common-offsets.h
arch/um/kernel/time.c
arch/um/os-Linux/skas/process.c