Skip to content

Commit 54577e2

Browse files
chaikenpaulmckrcu
authored andcommitted
rcu: Make priority of grace-period thread consistent
The priority of RCU grace period threads is set to kthread_prio when they are launched from rcu_spawn_gp_kthread(). The same is not true of rcu_spawn_one_nocb_kthread(). Accordingly, add priority elevation to rcu_spawn_one_nocb_kthread(). Signed-off-by: Alison Chaiken <achaiken@aurora.tech> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent c8db27d commit 54577e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/rcu/tree_nocb.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,7 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu)
12391239
struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
12401240
struct rcu_data *rdp_gp;
12411241
struct task_struct *t;
1242+
struct sched_param sp;
12421243

12431244
if (!rcu_scheduler_fully_active || !rcu_nocb_is_setup)
12441245
return;
@@ -1248,6 +1249,7 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu)
12481249
return;
12491250

12501251
/* If we didn't spawn the GP kthread first, reorganize! */
1252+
sp.sched_priority = kthread_prio;
12511253
rdp_gp = rdp->nocb_gp_rdp;
12521254
mutex_lock(&rdp_gp->nocb_gp_kthread_mutex);
12531255
if (!rdp_gp->nocb_gp_kthread) {
@@ -1258,6 +1260,8 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu)
12581260
return;
12591261
}
12601262
WRITE_ONCE(rdp_gp->nocb_gp_kthread, t);
1263+
if (kthread_prio)
1264+
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
12611265
}
12621266
mutex_unlock(&rdp_gp->nocb_gp_kthread_mutex);
12631267

0 commit comments

Comments
 (0)