summaryrefslogtreecommitdiff
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2023-10-27 16:40:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-10 17:16:56 +0100
commit547c59c83abfc2abfae20262cf30d14c9e73f350 (patch)
tree29dbd9be8426a92321411aecf6646353b83f0d6d /kernel/rcu/tree.c
parent39d04e558882ca317c5e64cc99c2a03494047257 (diff)
downloadlinux-547c59c83abfc2abfae20262cf30d14c9e73f350.tar.gz
linux-547c59c83abfc2abfae20262cf30d14c9e73f350.tar.bz2
linux-547c59c83abfc2abfae20262cf30d14c9e73f350.zip
rcu: Introduce rcu_cpu_online()
[ Upstream commit 2be4686d866ad5896f2bb94d82fe892197aea9c7 ] Export the RCU point of view as to when a CPU is considered offline (ie: when does RCU consider that a CPU is sufficiently down in the hotplug process to not feature any possible read side). This will be used by RCU-tasks whose vision of an offline CPU should reasonably match the one of RCU core. Fixes: cff9b2332ab7 ("kernel/sched: Modify initial boot task idle setup") Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 92a090e16186..9af42eae1ba3 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -4139,6 +4139,13 @@ static bool rcu_rdp_cpu_online(struct rcu_data *rdp)
return !!(rdp->grpmask & rcu_rnp_online_cpus(rdp->mynode));
}
+bool rcu_cpu_online(int cpu)
+{
+ struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
+
+ return rcu_rdp_cpu_online(rdp);
+}
+
#if defined(CONFIG_PROVE_RCU) && defined(CONFIG_HOTPLUG_CPU)
/*