All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] rcu: Make defer_qs_iw as hard irq-work under RT kernel with strict grace period configuration
@ 2022-04-03 23:59 Zqiang
  0 siblings, 0 replies; only message in thread
From: Zqiang @ 2022-04-03 23:59 UTC (permalink / raw)
  To: paulmck, frederic; +Cc: rcu, linux-kernel

When the CONFIG_RCU_STRICT_GRACE_PERIOD is enabled, on non-PREEMPT_RT
kernel, the init_irq_work() make the defer_qs_iw irq-work execute in
interrupt context. however, on PREEMPT_RT kernel, the init_irq_work()
make defer_qs_iq irq-work execute in rt-fifo irq_work kthreads. when
system booting, there are a lot of defer_qs_iw irq-work to be processed
in rt-fifo irq_work kthreads, it occupies boot CPU for long time and
cause other kthread cannot get the boot CPU, the boot process occurs
hang. use IRQ_WORK_INIT_HARD() to initialize defer_qs_iw irq-work, can
ensure the defer_qs_iw irq-work execute in interrupt context, under
PREEMPT_RT kernel with the CONFIG_RCU_STRICT_GRACE_PERIOD is enabled.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
 v1->v2:
 Use IRQ_WORK_INIT_HARD initialize defer_qs_iw only under RT kernel
 with CONFIG_RCU_STRICT_GRACE_PERIOD is enabled. 

 kernel/rcu/tree_plugin.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 3037c2536e1f..e6196a23793c 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -661,7 +661,13 @@ static void rcu_read_unlock_special(struct task_struct *t)
 			    expboost && !rdp->defer_qs_iw_pending && cpu_online(rdp->cpu)) {
 				// Get scheduler to re-evaluate and call hooks.
 				// If !IRQ_WORK, FQS scan will eventually IPI.
-				init_irq_work(&rdp->defer_qs_iw, rcu_preempt_deferred_qs_handler);
+				if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) &&
+							IS_ENABLED(CONFIG_PREEMPT_RT))
+					rdp->defer_qs_iw = IRQ_WORK_INIT_HARD(
+								rcu_preempt_deferred_qs_handler);
+				else
+					init_irq_work(&rdp->defer_qs_iw,
+							rcu_preempt_deferred_qs_handler);
 				rdp->defer_qs_iw_pending = true;
 				irq_work_queue_on(&rdp->defer_qs_iw, rdp->cpu);
 			}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-03 23:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 23:59 [PATCH v2] rcu: Make defer_qs_iw as hard irq-work under RT kernel with strict grace period configuration Zqiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.