2020-09-04 20:10:21 +00:00
|
|
|
From 025c5c2cce5efd9e9e7bbd510ed7044ba8df97b4 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <025c5c2cce5efd9e9e7bbd510ed7044ba8df97b4.1599166690.git.zanussi@kernel.org>
|
|
|
|
In-Reply-To: <56457dc415803c8abc5acb513ada877a79596f05.1599166690.git.zanussi@kernel.org>
|
|
|
|
References: <56457dc415803c8abc5acb513ada877a79596f05.1599166690.git.zanussi@kernel.org>
|
2019-02-27 18:51:46 +00:00
|
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
Date: Tue, 19 Feb 2019 16:49:29 +0100
|
2020-09-04 20:10:21 +00:00
|
|
|
Subject: [PATCH 126/333] softirq: Avoid "local_softirq_pending" messages if
|
2019-04-08 23:49:20 +00:00
|
|
|
task is in cpu_chill()
|
2020-09-04 20:10:21 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.142-rt63.tar.xz
|
2019-02-27 18:51:46 +00:00
|
|
|
|
|
|
|
If the softirq thread enters cpu_chill() then ->state is UNINTERRUPTIBLE
|
|
|
|
and has no ->pi_blocked_on set and so its mask is not taken into account.
|
|
|
|
|
|
|
|
->sleeping_lock is increased by cpu_chill() since it is also requried to
|
|
|
|
avoid a splat by RCU in case cpu_chill() is used while a RCU-read lock
|
|
|
|
is held. Use the same mechanism for the softirq-pending check.
|
|
|
|
|
|
|
|
Cc: stable-rt@vger.kernel.org
|
|
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
kernel/softirq.c | 5 ++++-
|
2019-02-27 18:51:46 +00:00
|
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/kernel/softirq.c b/kernel/softirq.c
|
|
|
|
index 1920985eeb09..27a4bb2303d0 100644
|
2019-02-27 18:51:46 +00:00
|
|
|
--- a/kernel/softirq.c
|
|
|
|
+++ b/kernel/softirq.c
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -105,9 +105,12 @@ static bool softirq_check_runner_tsk(struct task_struct *tsk,
|
2019-02-27 18:51:46 +00:00
|
|
|
* _before_ it sets pi_blocked_on to NULL under
|
|
|
|
* tsk->pi_lock. So we need to check for both: state
|
|
|
|
* and pi_blocked_on.
|
|
|
|
+ * The test against UNINTERRUPTIBLE + ->sleeping_lock is in case the
|
|
|
|
+ * task does cpu_chill().
|
|
|
|
*/
|
|
|
|
raw_spin_lock(&tsk->pi_lock);
|
|
|
|
- if (tsk->pi_blocked_on || tsk->state == TASK_RUNNING) {
|
|
|
|
+ if (tsk->pi_blocked_on || tsk->state == TASK_RUNNING ||
|
|
|
|
+ (tsk->state == TASK_UNINTERRUPTIBLE && tsk->sleeping_lock)) {
|
|
|
|
/* Clear all bits pending in that task */
|
|
|
|
*pending &= ~(tsk->softirqs_raised);
|
|
|
|
ret = true;
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-06-22 13:14:16 +00:00
|
|
|
2.17.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|