[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191003154555.383362319@linuxfoundation.org>
Date: Thu, 3 Oct 2019 17:53:25 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Paul E. McKenney" <paulmck@...ux.ibm.com>,
Juri Lelli <juri.lelli@...hat.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.2 227/313] rcu/tree: Fix SCHED_FIFO params
From: Peter Zijlstra <peterz@...radead.org>
[ Upstream commit 130d9c331bc59a8733b47c58ef197a2b1fa3ed43 ]
A rather embarrasing mistake had us call sched_setscheduler() before
initializing the parameters passed to it.
Fixes: 1a763fd7c633 ("rcu/tree: Call setschedule() gp ktread to SCHED_FIFO outside of atomic region")
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Paul E. McKenney <paulmck@...ux.ibm.com>
Cc: Juri Lelli <juri.lelli@...hat.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
kernel/rcu/tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 32ea75acba144..affa7aae758f3 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3123,13 +3123,13 @@ static int __init rcu_spawn_gp_kthread(void)
t = kthread_create(rcu_gp_kthread, NULL, "%s", rcu_state.name);
if (WARN_ONCE(IS_ERR(t), "%s: Could not start grace-period kthread, OOM is now expected behavior\n", __func__))
return 0;
- if (kthread_prio)
+ if (kthread_prio) {
+ sp.sched_priority = kthread_prio;
sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
+ }
rnp = rcu_get_root();
raw_spin_lock_irqsave_rcu_node(rnp, flags);
rcu_state.gp_kthread = t;
- if (kthread_prio)
- sp.sched_priority = kthread_prio;
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
wake_up_process(t);
rcu_spawn_nocb_kthreads();
--
2.20.1
Powered by blists - more mailing lists