public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
	rostedt@goodmis.org, Alison Chaiken <achaiken@aurora.tech>,
	"Paul E . McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 07/10] rcu: Elevate priority of offloaded callback threads
Date: Fri,  4 Feb 2022 15:24:03 -0800	[thread overview]
Message-ID: <20220204232406.814-7-paulmck@kernel.org> (raw)
In-Reply-To: <20220204232355.GA728@paulmck-ThinkPad-P17-Gen-1>

From: Alison Chaiken <achaiken@aurora.tech>

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.

Signed-off-by: Alison Chaiken <achaiken@aurora.tech>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/rcu/tree.c      | 2 +-
 kernel/rcu/tree_nocb.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 5bf0312f66760..9e4c5b281f003 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -153,7 +153,7 @@ static void sync_sched_exp_online_cleanup(int cpu);
 static void check_cb_ovld_locked(struct rcu_data *rdp, struct rcu_node *rnp);
 static bool rcu_rdp_is_offloaded(struct rcu_data *rdp);
 
-/* rcuc/rcub kthread realtime priority */
+/* rcuc/rcub/rcuop kthread realtime priority */
 static int kthread_prio = IS_ENABLED(CONFIG_RCU_BOOST) ? 1 : 0;
 module_param(kthread_prio, int, 0444);
 
diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index ea889cbfc3b95..547c41437c767 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -1270,6 +1270,9 @@ static void rcu_spawn_cpu_nocb_kthread(int cpu)
 			"rcuo%c/%d", rcu_state.abbr, cpu);
 	if (WARN_ONCE(IS_ERR(t), "%s: Could not start rcuo CB kthread, OOM is now expected behavior\n", __func__))
 		return;
+
+	if (kthread_prio)
+		sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
 	WRITE_ONCE(rdp->nocb_cb_kthread, t);
 	WRITE_ONCE(rdp->nocb_gp_kthread, rdp_gp->nocb_gp_kthread);
 }
-- 
2.31.1.189.g2e36527f23


  parent reply	other threads:[~2022-02-04 23:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 23:23 [PATCH rcu 0/10] Real-time-related updates for v5.18 Paul E. McKenney
2022-02-04 23:23 ` [PATCH rcu 01/10] rcu: Mark accesses to boost_starttime Paul E. McKenney
2022-02-04 23:23 ` [PATCH rcu 02/10] rcu/nocb: Handle concurrent nocb kthreads creation Paul E. McKenney
2022-02-04 23:23 ` [PATCH rcu 03/10] rcu: Remove unused rcu_state.boost Paul E. McKenney
2022-02-04 23:24 ` [PATCH rcu 04/10] rcu: Create per-cpu rcuc kthreads only when rcutree.use_softirq=0 Paul E. McKenney
2022-02-04 23:24 ` [PATCH rcu 05/10] rcu: Move kthread_prio bounds-check to a separate function Paul E. McKenney
2022-02-04 23:24 ` [PATCH rcu 06/10] rcu: Make priority of grace-period thread consistent Paul E. McKenney
2022-02-04 23:24 ` Paul E. McKenney [this message]
2022-02-04 23:24 ` [PATCH rcu 08/10] rcu: Update documentation regarding kthread_prio cmdline parameter Paul E. McKenney
2022-02-04 23:24 ` [PATCH rcu 09/10] rcu: Don't deboost before reporting expedited quiescent state Paul E. McKenney
2022-02-04 23:24 ` [PATCH rcu 10/10] rcu: Add per-CPU rcuc task dumps to RCU CPU stall warnings Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220204232406.814-7-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=achaiken@aurora.tech \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox