[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231107215742.363031-50-ankur.a.arora@oracle.com>
Date: Tue, 7 Nov 2023 13:57:35 -0800
From: Ankur Arora <ankur.a.arora@...cle.com>
To: linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de, peterz@...radead.org,
torvalds@...ux-foundation.org, paulmck@...nel.org,
linux-mm@...ck.org, x86@...nel.org, akpm@...ux-foundation.org,
luto@...nel.org, bp@...en8.de, dave.hansen@...ux.intel.com,
hpa@...or.com, mingo@...hat.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, willy@...radead.org, mgorman@...e.de,
jon.grimm@....com, bharata@....com, raghavendra.kt@....com,
boris.ostrovsky@...cle.com, konrad.wilk@...cle.com,
jgross@...e.com, andrew.cooper3@...rix.com, mingo@...nel.org,
bristot@...nel.org, mathieu.desnoyers@...icios.com,
geert@...ux-m68k.org, glaubitz@...sik.fu-berlin.de,
anton.ivanov@...bridgegreys.com, mattst88@...il.com,
krypton@...ich-teichert.org, rostedt@...dmis.org,
David.Laight@...LAB.COM, richard@....at, mjguzik@...il.com,
Ankur Arora <ankur.a.arora@...cle.com>
Subject: [RFC PATCH 49/86] osnoise: handle quiescent states directly
To reduce RCU noise for the stopped tick case we introduce explicit
quiescent states for PREEMPT_RCU=y, and depend on cond_resched()
(and thus rcu_all_qs()) to handle PREEMPT_RCU=n.
With cond_resched() going away, introduce explicit quiescent states
for all configurations.
Suggested-by: Paul E. McKenney <paulmck@...nel.org>
Signed-off-by: Ankur Arora <ankur.a.arora@...cle.com>
---
kernel/trace/trace_osnoise.c | 37 ++++++++++++------------------------
1 file changed, 12 insertions(+), 25 deletions(-)
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index bd0d01d00fb9..db38934c4242 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1531,34 +1531,21 @@ static int run_osnoise(void)
/*
* In some cases, notably when running on a nohz_full CPU with
- * a stopped tick PREEMPT_RCU has no way to account for QSs.
- * This will eventually cause unwarranted noise as PREEMPT_RCU
- * will force preemption as the means of ending the current
- * grace period. We avoid this problem by calling
- * rcu_momentary_dyntick_idle(), which performs a zero duration
- * EQS allowing PREEMPT_RCU to end the current grace period.
- * This call shouldn't be wrapped inside an RCU critical
- * section.
- *
- * Note that in non PREEMPT_RCU kernels QSs are handled through
- * cond_resched()
+ * a stopped tick RCU has no way to account for QSs. This will
+ * eventually cause unwarranted noise as RCU forces preemption
+ * as the means of ending the current grace period.
+ * We avoid this problem by calling rcu_momentary_dyntick_idle(),
+ * which performs a zero duration EQS allowing RCU to end the
+ * current grace period. This call shouldn't be wrapped inside
+ * an RCU critical section.
*/
- if (IS_ENABLED(CONFIG_PREEMPT_RCU)) {
- if (!disable_irq)
- local_irq_disable();
+ if (!disable_irq)
+ local_irq_disable();
- rcu_momentary_dyntick_idle();
+ rcu_momentary_dyntick_idle();
- if (!disable_irq)
- local_irq_enable();
- }
-
- /*
- * For the non-preemptive kernel config: let threads runs, if
- * they so wish, unless set not do to so.
- */
- if (!disable_irq && !disable_preemption)
- cond_resched();
+ if (!disable_irq)
+ local_irq_enable();
last_sample = sample;
last_int_count = int_count;
--
2.31.1
Powered by blists - more mailing lists