Skip to content

Commit

Permalink
XANMOD: rcu: Change sched_setscheduler_nocheck() calls to SCHED_RR po…
Browse files Browse the repository at this point in the history
…licy

Signed-off-by: Alexandre Frade <kernel@xanmod.org>
  • Loading branch information
xanmod committed Oct 12, 2022
1 parent e37807b commit ee134f7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4710,7 +4710,7 @@
overwritten.

rcutree.kthread_prio= [KNL,BOOT]
Set the SCHED_FIFO priority of the RCU per-CPU
Set the SCHED_RR priority of the RCU per-CPU
kthreads (rcuc/N). This value is also used for
the priority of the RCU boost threads (rcub/N)
and for the RCU grace-period kthreads (rcu_bh,
Expand Down
4 changes: 2 additions & 2 deletions kernel/rcu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ config RCU_NOCB_CPU_CB_BOOST
depends on RCU_NOCB_CPU && RCU_BOOST
default y if PREEMPT_RT
help
Use this option to invoke offloaded callbacks as SCHED_FIFO
Use this option to invoke offloaded callbacks as SCHED_RR
to avoid starvation by heavy SCHED_OTHER background load.
Of course, running as SCHED_FIFO during callback floods will
Of course, running as SCHED_RR during callback floods will
cause the rcuo[ps] kthreads to monopolize the CPU for hundreds
of milliseconds or more. Therefore, when enabling this option,
it is your responsibility to ensure that latency-sensitive
Expand Down
2 changes: 1 addition & 1 deletion kernel/rcu/rcutorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ static int rcutorture_booster_init(unsigned int cpu)
t = per_cpu(ksoftirqd, cpu);
WARN_ON_ONCE(!t);
sp.sched_priority = 2;
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
sched_setscheduler_nocheck(t, SCHED_RR, &sp);
}

/* Don't allow time recalculation while creating a new task. */
Expand Down
6 changes: 3 additions & 3 deletions kernel/rcu/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4236,8 +4236,8 @@ static void __init rcu_start_exp_gp_kworkers(void)
return;
}

sched_setscheduler_nocheck(rcu_exp_gp_kworker->task, SCHED_FIFO, &param);
sched_setscheduler_nocheck(rcu_exp_par_gp_kworker->task, SCHED_FIFO,
sched_setscheduler_nocheck(rcu_exp_gp_kworker->task, SCHED_RR, &param);
sched_setscheduler_nocheck(rcu_exp_par_gp_kworker->task, SCHED_RR,
&param);
}

Expand Down Expand Up @@ -4275,7 +4275,7 @@ static int __init rcu_spawn_gp_kthread(void)
return 0;
if (kthread_prio) {
sp.sched_priority = kthread_prio;
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
sched_setscheduler_nocheck(t, SCHED_RR, &sp);
}
rnp = rcu_get_root();
raw_spin_lock_irqsave_rcu_node(rnp, flags);
Expand Down
4 changes: 2 additions & 2 deletions kernel/rcu/tree_nocb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu)
}
WRITE_ONCE(rdp_gp->nocb_gp_kthread, t);
if (kthread_prio)
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
sched_setscheduler_nocheck(t, SCHED_RR, &sp);
}
mutex_unlock(&rdp_gp->nocb_gp_kthread_mutex);

Expand All @@ -1330,7 +1330,7 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu)
goto end;

if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_CB_BOOST) && kthread_prio)
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
sched_setscheduler_nocheck(t, SCHED_RR, &sp);

WRITE_ONCE(rdp->nocb_cb_kthread, t);
WRITE_ONCE(rdp->nocb_gp_kthread, rdp_gp->nocb_gp_kthread);
Expand Down
4 changes: 2 additions & 2 deletions kernel/rcu/tree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ static void rcu_cpu_kthread_setup(unsigned int cpu)
struct sched_param sp;

sp.sched_priority = kthread_prio;
sched_setscheduler_nocheck(current, SCHED_FIFO, &sp);
sched_setscheduler_nocheck(current, SCHED_RR, &sp);
#endif /* #ifdef CONFIG_RCU_BOOST */

WRITE_ONCE(rdp->rcuc_activity, jiffies);
Expand Down Expand Up @@ -1205,7 +1205,7 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp)
rnp->boost_kthread_task = t;
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
sp.sched_priority = kthread_prio;
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
sched_setscheduler_nocheck(t, SCHED_RR, &sp);
wake_up_process(t); /* get to TASK_INTERRUPTIBLE quickly. */

out:
Expand Down

0 comments on commit ee134f7

Please sign in to comment.