lkml.org 
[lkml]   [2022]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] rcu: Avoid invalid wakeup for rcuc kthreads in RCU_KTHREAD_OFFCPU status
Date
For CONFIG_PREEMPT_RT=y kernel, the "use_softirq=0" will be set, the
RCU_SOFTIRQ processing is moved to per-CPU rcuc kthreads which created
by smpboot_register_percpu_thread(). when CPU is going offline, the
corresponding rcu_data.rcu_cpu_kthread_status is set RCU_KTHREAD_OFFCPU,
and the rcuc kthreads enter TASK_PARKED state, kthreads in TASK_PARKED
state only accept kthread_unpark() to wakeup.

Therefore, This commit avoid invoke wake_up_process() to rcuc kthreads
in TASK_PARKED state.

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

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 3ccad468887e..49dd87356851 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2375,7 +2375,8 @@ static void rcu_wake_cond(struct task_struct *t, int status)
* If the thread is yielding, only wake it when this
* is invoked from idle
*/
- if (t && (status != RCU_KTHREAD_YIELDING || is_idle_task(current)))
+ if (t && (status != RCU_KTHREAD_YIELDING || is_idle_task(current)) &&
+ status != RCU_KTHREAD_OFFCPU)
wake_up_process(t);
}

--
2.25.1
\
 
 \ /
  Last update: 2022-11-15 14:14    [W:0.072 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site