[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241009125127.18902-4-neeraj.upadhyay@kernel.org>
Date: Wed, 9 Oct 2024 18:21:20 +0530
From: neeraj.upadhyay@...nel.org
To: rcu@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
paulmck@...nel.org,
joel@...lfernandes.org,
frederic@...nel.org,
boqun.feng@...il.com,
urezki@...il.com,
rostedt@...dmis.org,
mathieu.desnoyers@...icios.com,
jiangshanlai@...il.com,
qiang.zhang1211@...il.com,
peterz@...radead.org,
neeraj.upadhyay@....com,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>
Subject: [PATCH v2 03/10] rcu/tasks: Move holdout checks for idle task to a separate function
From: Neeraj Upadhyay <neeraj.upadhyay@...nel.org>
Move checks for an idle task being a holdout task for RCU-tasks
to a separate function - rcu_idle_task_is_holdout(). This function
will be used in subsequent commits to add additional checks for
idle task. No functional change intended.
Suggested-by: Frederic Weisbecker <frederic@...nel.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@...nel.org>
---
kernel/rcu/tasks.h | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 6333f4ccf024..56015ced3f37 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -976,6 +976,15 @@ static void rcu_tasks_pregp_step(struct list_head *hop)
synchronize_rcu();
}
+static bool rcu_idle_task_is_holdout(struct task_struct *t, int cpu)
+{
+ /* Idle tasks on offline CPUs are RCU-tasks quiescent states. */
+ if (!rcu_cpu_online(cpu))
+ return false;
+
+ return true;
+}
+
/* Check for quiescent states since the pregp's synchronize_rcu() */
static bool rcu_tasks_is_holdout(struct task_struct *t)
{
@@ -995,9 +1004,8 @@ static bool rcu_tasks_is_holdout(struct task_struct *t)
cpu = task_cpu(t);
- /* Idle tasks on offline CPUs are RCU-tasks quiescent states. */
- if (t == idle_task(cpu) && !rcu_cpu_online(cpu))
- return false;
+ if (t == idle_task(cpu))
+ return rcu_idle_task_is_holdout(t, cpu);
return true;
}
--
2.40.1
Powered by blists - more mailing lists