From 30ac483e3c3ffa63b9e92596fa25118e25116438 Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Thu, 6 Jan 2022 16:54:18 -0800 Subject: [PATCH 1/4] xen: RCU: bootparam to force quiescence at every call. Signed-off-by: Dario Faggioli --- xen/arch/arm/traps.c | 3 +++ xen/common/rcupdate.c | 10 ++++++++++ xen/include/xen/rcupdate.h | 2 ++ 3 files changed, 15 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 9339d12f58..e2842ba4db 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -87,7 +87,10 @@ static enum { static int __init parse_vwfi(const char *s) { if ( !strcmp(s, "native") ) + { + rcu_always_quiesc = true; vwfi = NATIVE; + } else vwfi = TRAP; diff --git a/xen/common/rcupdate.c b/xen/common/rcupdate.c index a5a27af3de..7316271da5 100644 --- a/xen/common/rcupdate.c +++ b/xen/common/rcupdate.c @@ -95,6 +95,9 @@ struct rcu_data { bool barrier_active; }; +bool rcu_always_quiesc = false; +boolean_param("rcu_force_quiesc", rcu_always_quiesc); + /* * If a CPU with RCU callbacks queued goes idle, when the grace period is * not finished yet, how can we make sure that the callbacks will eventually @@ -637,6 +640,13 @@ static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp, rdp->quiescbatch = rcp->completed; rdp->qs_pending = 0; rdp->cpu = cpu; + if ( rcu_always_quiesc ) + { + blimit = INT_MAX; + qhimark = 0; + qlowmark = 0; + //rsinterval = 0; + } rdp->blimit = blimit; init_timer(&rdp->idle_timer, rcu_idle_timer_handler, rdp, cpu); } diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h index 6f2587058e..d279e39022 100644 --- a/xen/include/xen/rcupdate.h +++ b/xen/include/xen/rcupdate.h @@ -78,6 +78,8 @@ struct rcu_head { } while (0) +extern bool rcu_always_quiesc; + int rcu_pending(int cpu); int rcu_needs_cpu(int cpu); -- 2.25.1