summaryrefslogtreecommitdiff
path: root/arch/um/include/shared
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin.berg@intel.com>2024-10-10 17:25:37 +0300
committerJohannes Berg <johannes.berg@intel.com>2024-10-23 10:52:49 +0300
commit0b8b2668f9981c1fefc2ef892bd915288ef01f33 (patch)
treef6ab4464c0555dbf073d5e65d46a652da5ac9c6e /arch/um/include/shared
parent9b0881858c74ae6a1a66de7350d123cf3f83169f (diff)
downloadlinux-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/include/shared')
-rw-r--r--arch/um/include/shared/common-offsets.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h
index 579ed946a3a9..86537e20942a 100644
--- a/arch/um/include/shared/common-offsets.h
+++ b/arch/um/include/shared/common-offsets.h
@@ -28,4 +28,8 @@ DEFINE(UML_CONFIG_64BIT, CONFIG_64BIT);
#ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT
DEFINE(UML_CONFIG_UML_TIME_TRAVEL_SUPPORT, CONFIG_UML_TIME_TRAVEL_SUPPORT);
#endif
-
+#ifdef CONFIG_UML_MAX_USERSPACE_ITERATIONS
+DEFINE(UML_CONFIG_UML_MAX_USERSPACE_ITERATIONS, CONFIG_UML_MAX_USERSPACE_ITERATIONS);
+#else
+DEFINE(UML_CONFIG_UML_MAX_USERSPACE_ITERATIONS, 0);
+#endif