Skip to content

Commit ed1b672

Browse files
osnoise: provide quiescent states
JIRA: https://issues.redhat.com/browse/RHEL-117874 commit 9fd858c Author: Ankur Arora <ankur.a.arora@oracle.com> Date: Thu Dec 12 20:06:57 2024 -0800 osnoise: provide quiescent states To reduce RCU noise for nohz_full configurations, osnoise depends on cond_resched() providing quiescent states for PREEMPT_RCU=n configurations. For PREEMPT_RCU=y configurations -- where cond_resched() is a stub -- we do this by directly calling rcu_momentary_eqs(). With (PREEMPT_LAZY=y, PREEMPT_DYNAMIC=n), however, we have a configuration with (PREEMPTION=y, PREEMPT_RCU=n) where neither of the above can help. Handle that by providing an explicit quiescent state here for all configurations. As mentioned above this is not needed for non-stubbed cond_resched(), but, providing a quiescent state here just pulls in one that a future cond_resched() would provide, so doesn't cause any extra work for this configuration. Cc: Paul E. McKenney <paulmck@kernel.org> Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Suggested-by: Paul E. McKenney <paulmck@kernel.org> Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Tomas Glozar <tglozar@redhat.com>
1 parent 2a10026 commit ed1b672

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

kernel/trace/trace_osnoise.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,27 +1525,25 @@ static int run_osnoise(void)
15251525

15261526
/*
15271527
* In some cases, notably when running on a nohz_full CPU with
1528-
* a stopped tick PREEMPT_RCU has no way to account for QSs.
1529-
* This will eventually cause unwarranted noise as PREEMPT_RCU
1530-
* will force preemption as the means of ending the current
1531-
* grace period. We avoid this problem by calling
1532-
* rcu_momentary_eqs(), which performs a zero duration
1533-
* EQS allowing PREEMPT_RCU to end the current grace period.
1534-
* This call shouldn't be wrapped inside an RCU critical
1535-
* section.
1528+
* a stopped tick PREEMPT_RCU or PREEMPT_LAZY have no way to
1529+
* account for QSs. This will eventually cause unwarranted
1530+
* noise as RCU forces preemption as the means of ending the
1531+
* current grace period. We avoid this by calling
1532+
* rcu_momentary_eqs(), which performs a zero duration EQS
1533+
* allowing RCU to end the current grace period. This call
1534+
* shouldn't be wrapped inside an RCU critical section.
15361535
*
1537-
* Note that in non PREEMPT_RCU kernels QSs are handled through
1538-
* cond_resched()
1536+
* Normally QSs for other cases are handled through cond_resched().
1537+
* For simplicity, however, we call rcu_momentary_eqs() for all
1538+
* configurations here.
15391539
*/
1540-
if (IS_ENABLED(CONFIG_PREEMPT_RCU)) {
1541-
if (!disable_irq)
1542-
local_irq_disable();
1540+
if (!disable_irq)
1541+
local_irq_disable();
15431542

1544-
rcu_momentary_eqs();
1543+
rcu_momentary_eqs();
15451544

1546-
if (!disable_irq)
1547-
local_irq_enable();
1548-
}
1545+
if (!disable_irq)
1546+
local_irq_enable();
15491547

15501548
/*
15511549
* For the non-preemptive kernel config: let threads runs, if

0 commit comments

Comments
 (0)