lkml.org 
[lkml]   [2022]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] rcu-tasks: Make synchronize_rcu_tasks_generic() no-ops on early booting
Date
When the rcu_scheduler_active variable is RCU_SCHEDULER_INACTIVE and not
yet converted to RCU_SCHEDULER_INIT, there is only idle task, any legal
call synchronize_rcu_tasks_generic() is a quiescent state. this commit
make synchronize_rcu_tasks_generic() no-ops when the rcu_scheduler_active
variable is RCU_SCHEDULER_INACTIVE.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
kernel/rcu/tasks.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 469bf2a3b505..0237e765c28e 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -560,8 +560,9 @@ static int __noreturn rcu_tasks_kthread(void *arg)
static void synchronize_rcu_tasks_generic(struct rcu_tasks *rtp)
{
/* Complain if the scheduler has not started. */
- WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
- "synchronize_rcu_tasks called too soon");
+ if (WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
+ "synchronize_rcu_tasks called too soon"))
+ return;

// If the grace-period kthread is running, use it.
if (READ_ONCE(rtp->kthread_ptr)) {
--
2.25.1
\
 
 \ /
  Last update: 2022-07-12 10:27    [W:0.108 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site