Skip to content

Commit 10d4703

Browse files
Frederic Weisbeckerpaulmckrcu
authored andcommitted
rcu/nocb: Merge rcu_spawn_cpu_nocb_kthread() and rcu_spawn_one_nocb_kthread()
The rcu_spawn_one_nocb_kthread() function is called only from rcu_spawn_cpu_nocb_kthread(). Therefore, inline the former into the latter, saving a few lines of code. Reviewed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Uladzislau Rezki <urezki@gmail.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Joel Fernandes <joel@joelfernandes.org> Tested-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent d2cf085 commit 10d4703

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

kernel/rcu/tree_nocb.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,12 +1233,15 @@ static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp)
12331233
* rcuo CB kthread, spawn it. Additionally, if the rcuo GP kthread
12341234
* for this CPU's group has not yet been created, spawn it as well.
12351235
*/
1236-
static void rcu_spawn_one_nocb_kthread(int cpu)
1236+
static void rcu_spawn_cpu_nocb_kthread(int cpu)
12371237
{
12381238
struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
12391239
struct rcu_data *rdp_gp;
12401240
struct task_struct *t;
12411241

1242+
if (!rcu_scheduler_fully_active || !rcu_nocb_is_setup)
1243+
return;
1244+
12421245
/* If there already is an rcuo kthread, then nothing to do. */
12431246
if (rdp->nocb_cb_kthread)
12441247
return;
@@ -1262,16 +1265,6 @@ static void rcu_spawn_one_nocb_kthread(int cpu)
12621265
WRITE_ONCE(rdp->nocb_gp_kthread, rdp_gp->nocb_gp_kthread);
12631266
}
12641267

1265-
/*
1266-
* If the specified CPU is a no-CBs CPU that does not already have its
1267-
* rcuo kthread, spawn it.
1268-
*/
1269-
static void rcu_spawn_cpu_nocb_kthread(int cpu)
1270-
{
1271-
if (rcu_scheduler_fully_active && rcu_nocb_is_setup)
1272-
rcu_spawn_one_nocb_kthread(cpu);
1273-
}
1274-
12751268
/*
12761269
* Once the scheduler is running, spawn rcuo kthreads for all online
12771270
* no-CBs CPUs. This assumes that the early_initcall()s happen before

0 commit comments

Comments
 (0)