History

rcu: Elevate priority of offloaded callback threads

When CONFIG_PREEMPT_RT=y, the rcutree.kthread_prio command-line parameter signals initialization code to boost the priority of rcuc callbacks to the designated value. With the additional CONFIG_RCU_NOCB_CPU=y configuration and an additional rcu_nocbs command-line parameter, the callbacks on the listed cores are offloaded to new rcuop kthreads that are not pinned to the cores whose post-grace-period work is performed. While the rcuop kthreads perform the same function as the rcuc kthreads they offload, the kthread_prio parameter only boosts the priority of the rcuc kthreads. Fix this inconsistency by elevating rcuop kthreads to the same priority as the rcuc kthreads.

Alison Chaiken committed 4 years ago

Commit c8b16a61 parent 54577e22 files · +4 −1Browse files

Showing the changes to kernel (2 of 2 files). Show all

Unified · Split

2 files
  1. kernel/rcu/tree.c +1 −1
  2. kernel/rcu/tree_nocb.h +3 −0
kernel/rcu/tree.c+1−1
@@ -153,7 +153,7 @@ static void sync_sched_exp_online_cleanup(int cpu); · 152 unmodified lines
153static void check_cb_ovld_locked(struct rcu_data *rdp, struct rcu_node *rnp);153static void check_cb_ovld_locked(struct rcu_data *rdp, struct rcu_node *rnp);
154static bool rcu_rdp_is_offloaded(struct rcu_data *rdp);154static bool rcu_rdp_is_offloaded(struct rcu_data *rdp);
155 155
156/* rcuc/rcub kthread realtime priority */156/* rcuc/rcub/rcuop kthread realtime priority */
157static int kthread_prio = IS_ENABLED(CONFIG_RCU_BOOST) ? 1 : 0;157static int kthread_prio = IS_ENABLED(CONFIG_RCU_BOOST) ? 1 : 0;
158module_param(kthread_prio, int, 0444);158module_param(kthread_prio, int, 0444);
159 159
kernel/rcu/tree_nocb.h+3−0
@@ -1270,6 +1270,9 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu) · 1269 unmodified lines
1270 "rcuo%c/%d", rcu_state.abbr, cpu);1270 "rcuo%c/%d", rcu_state.abbr, cpu);
1271 if (WARN_ONCE(IS_ERR(t), "%s: Could not start rcuo CB kthread, OOM is now expected behavior\n", __func__))1271 if (WARN_ONCE(IS_ERR(t), "%s: Could not start rcuo CB kthread, OOM is now expected behavior\n", __func__))
1272 return;1272 return;
1273
1274 if (kthread_prio)
1275 sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
1273 WRITE_ONCE(rdp->nocb_cb_kthread, t);1276 WRITE_ONCE(rdp->nocb_cb_kthread, t);
1274 WRITE_ONCE(rdp->nocb_gp_kthread, rdp_gp->nocb_gp_kthread);1277 WRITE_ONCE(rdp->nocb_gp_kthread, rdp_gp->nocb_gp_kthread);
1275}1278}