um: work around sched_yield not yielding in time-travel mode
authorBenjamin Berg <benjamin.berg@intel.com>
Fri, 14 Mar 2025 13:08:15 +0000 (14:08 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 18 Mar 2025 10:06:20 +0000 (11:06 +0100)
commit887c5c12e80c8424bd471122d2e8b6b462e12874
tree259c6a7ccefbdbc5af825a49012d6a4eb1c6bd99
parent089db01ea7eb4f366be45b9390a04f1c601c0071
um: work around sched_yield not yielding in time-travel mode

sched_yield by a userspace may not actually cause scheduling in
time-travel mode as no time has passed. In the case seen it appears to
be a badly implemented userspace spinlock in ASAN. Unfortunately, with
time-travel it causes an extreme slowdown or even deadlock depending on
the kernel configuration (CONFIG_UML_MAX_USERSPACE_ITERATIONS).

Work around it by accounting time to the process whenever it executes a
sched_yield syscall.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250314130815.226872-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/include/linux/time-internal.h
arch/um/kernel/skas/syscall.c