From 757fdba9fd578d7765dce1c63c862afc4bbf3739 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 28 Jun 2022 10:18:50 +0200 Subject: [PATCH] dde_linux: set max timeout for rcu_needs_cpu Adhere to include/linux/rcutiny.h behaviour, which sets the max timeout for rcu_needs_cpu. Without the commit, in the most cases the timeout value is zero (or random since the pointer is on stack uninitialized), which leads to programming very short timeouts again and again, making the system never idle. Issue #4540 --- repos/dde_linux/src/lib/lx_emul/shadow/kernel/rcu/tree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repos/dde_linux/src/lib/lx_emul/shadow/kernel/rcu/tree.c b/repos/dde_linux/src/lib/lx_emul/shadow/kernel/rcu/tree.c index 007b7c3e9e..34728a0dc2 100644 --- a/repos/dde_linux/src/lib/lx_emul/shadow/kernel/rcu/tree.c +++ b/repos/dde_linux/src/lib/lx_emul/shadow/kernel/rcu/tree.c @@ -12,6 +12,7 @@ */ #include +#include /* KTIME_MAX */ extern void __rcu_read_lock(void); void __rcu_read_lock(void) { } @@ -22,5 +23,7 @@ void __rcu_read_unlock(void) { } int rcu_needs_cpu(u64 basemono, u64 *nextevt) { + if (nextevt) + *nextevt = KTIME_MAX; return 0; }