From f55736f7595bc028451658996eedea9742688bbc Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sun, 18 Aug 2024 18:25:39 -0700 Subject: [PATCH] Allow for more kernel book-keeping budget. Looke like modern kernels starve earlier if not given enough time to escape from realtime tasks. Increase the 1ms allowed budget to 10ms, which should still be under a visible threshold. --- lib/gpio.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gpio.cc b/lib/gpio.cc index 455b6becb..68edcdbf1 100644 --- a/lib/gpio.cc +++ b/lib/gpio.cc @@ -500,8 +500,8 @@ static void DisableRealtimeThrottling() { if (GetNumCores() == 1) return; // Not safe if we don't have > 1 core. // We need to leave the kernel a little bit of time, as it does not like // us to hog the kernel solidly. The default of 950000 leaves 50ms that - // can generate visible flicker, so we reduce that to 1ms. - WriteTo("/proc/sys/kernel/sched_rt_runtime_us", "999000"); + // can generate visible flicker, so we reduce that to 10ms. + WriteTo("/proc/sys/kernel/sched_rt_runtime_us", "990000"); } bool Timers::Init() {