Commit ed5e9462 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Greg Kroah-Hartman

tick/nohz: Prevent bogus softirq pending warning

Commit 0a0e0829 ("nohz: Fix missing tick reprogram when interrupting an
inline softirq") got backported to stable trees and now causes the NOHZ
softirq pending warning to trigger. It's not an upstream issue as the NOHZ
update logic has been changed there.

The problem is when a softirq disabled section gets interrupted and on
return from interrupt the tick/nohz state is evaluated, which then can
observe pending soft interrupts. These soft interrupts are legitimately
pending because they cannot be processed as long as soft interrupts are
disabled and the interrupted code will correctly process them when soft
interrupts are reenabled.

Add a check for softirqs disabled to the pending check to prevent the
warning.
Reported-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Reported-by: default avatarJohn Crispin <john@phrozen.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Tested-by: default avatarJohn Crispin <john@phrozen.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: stable@vger.kernel.org
Fixes: 2d898915 ("nohz: Fix missing tick reprogram when interrupting an inline softirq")
Acked-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent 3a411a04
......@@ -908,7 +908,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
if (unlikely(local_softirq_pending() && cpu_online(cpu))) {
static int ratelimit;
if (ratelimit < 10 &&
if (ratelimit < 10 && !in_softirq() &&
(local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) {
pr_warn("NOHZ: local_softirq_pending %02x\n",
(unsigned int) local_softirq_pending());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment