linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alison Chaiken <achaiken@aurora.tech>
To: tglx@linutronix.de
Cc: peterz@infradead.org, paulmck@kernel.org,
	valentin.schneider@arm.com, frederic@kernel.org,
	linux-kernel@vger.kernel.org, glenn@aurora.tech,
	alison@she-devel.com, Alison Chaiken <achaiken@aurora.tech>
Subject: [PATCH 2/4] RCU: make priority of grace-period thread consistent
Date: Tue, 11 Jan 2022 15:32:51 -0800	[thread overview]
Message-ID: <20220111233253.21692-3-achaiken@aurora.tech> (raw)
In-Reply-To: <20220111233253.21692-1-achaiken@aurora.tech>

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>
---
 kernel/rcu/tree_nocb.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index 8fdf44f8523f..08b5c0042979 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -1183,7 +1183,9 @@ static void rcu_spawn_one_nocb_kthread(int cpu)
 	struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
 	struct rcu_data *rdp_gp;
 	struct task_struct *t;
+	struct sched_param sp;
 
+	sp.sched_priority = kthread_prio;
 	/*
 	 * If this isn't a no-CBs CPU or if it already has an rcuo kthread,
 	 * then nothing to do.
@@ -1199,6 +1201,8 @@ static void rcu_spawn_one_nocb_kthread(int cpu)
 		if (WARN_ONCE(IS_ERR(t), "%s: Could not start rcuo GP kthread, OOM is now expected behavior\n", __func__))
 			return;
 		WRITE_ONCE(rdp_gp->nocb_gp_kthread, t);
+		if (kthread_prio)
+			sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
 	}
 
 	/* Spawn the kthread for this CPU. */
-- 
2.32.0


  parent reply	other threads:[~2022-01-13  2:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 23:32 [PATCH 0/5] handle kthread_prio kernel cmdline parameter consistently Alison Chaiken
2022-01-11 23:32 ` [PATCH 1/4] RCU: move kthread_prio bounds-check to a separate function Alison Chaiken
2022-01-11 23:32 ` Alison Chaiken [this message]
2022-01-11 23:32 ` [PATCH 3/4] RCU: elevate priority of offloaded callback threads Alison Chaiken
2022-01-11 23:32 ` [PATCH 4/4] RCU: update documentation regarding kthread_prio cmdline parameter Alison Chaiken
2022-01-12  1:03 ` [PATCH 0/5] handle kthread_prio kernel cmdline parameter consistently 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=20220111233253.21692-3-achaiken@aurora.tech \
    --to=achaiken@aurora.tech \
    --cc=alison@she-devel.com \
    --cc=frederic@kernel.org \
    --cc=glenn@aurora.tech \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=valentin.schneider@arm.com \
    /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;
as well as URLs for NNTP newsgroup(s).