linux-stable/kernel/time
Paul Gortmaker 55a448e8d8 tick/rcu: Fix false positive "softirq work is pending" messages
[ Upstream commit 96c1fa04f0 ]

In commit 0345691b24 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle") the
new function report_idle_softirq() was created by breaking code out of the
existing can_stop_idle_tick() for kernels v5.18 and newer.

In doing so, the code essentially went from a one conditional:

	if (a && b && c)
		warn();

to a three conditional:

	if (!a)
		return;
	if (!b)
		return;
	if (!c)
		return;
	warn();

But that conversion got the condition for the RT specific
local_bh_blocked() wrong. The original condition was:

   	!local_bh_blocked()

but the conversion failed to negate it so it ended up as:

        if (!local_bh_blocked())
		return false;

This issue lay dormant until another fixup for the same commit was added
in commit a7e282c777 ("tick/rcu: Fix bogus ratelimit condition").
This commit realized the ratelimit was essentially set to zero instead
of ten, and hence *no* softirq pending messages would ever be issued.

Once this commit was backported via linux-stable, both the v6.1 and v6.4
preempt-rt kernels started printing out 10 instances of this at boot:

  NOHZ tick-stop error: local softirq work is pending, handler #80!!!

Remove the negation and return when local_bh_blocked() evaluates to true to
bring the correct behaviour back.

Fixes: 0345691b24 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle")
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Wen Yang <wenyang.linux@foxmail.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230818200757.1808398-1-paul.gortmaker@windriver.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-13 09:42:57 +02:00
..
alarmtimer.c alarmtimer: Prevent starvation by small intervals and SIG_IGN 2023-02-22 12:59:55 +01:00
clockevents.c
clocksource-wdtest.c
clocksource.c clocksource: Suspend the watchdog temporarily when high read latency detected 2023-03-10 09:33:50 +01:00
hrtimer.c timers: Prevent union confusion from unexpected restart_syscall() 2023-03-10 09:33:49 +01:00
itimer.c
jiffies.c
Kconfig
Makefile
namespace.c
ntp.c
ntp_internal.h
posix-clock.c
posix-cpu-timers.c posix-cpu-timers: Implement the missing timer_wait_running callback 2023-05-11 23:03:00 +09:00
posix-stubs.c timers: Prevent union confusion from unexpected restart_syscall() 2023-03-10 09:33:49 +01:00
posix-timers.c posix-timers: Prevent RT livelock in itimer_delete() 2023-07-19 16:20:59 +02:00
posix-timers.h
sched_clock.c
test_udelay.c time/debug: Fix memory leak with using debugfs_lookup() 2023-03-10 09:33:52 +01:00
tick-broadcast-hrtimer.c
tick-broadcast.c tick/broadcast: Make broadcast device replacement work correctly 2023-05-24 17:32:31 +01:00
tick-common.c tick/common: Align tick period during sched_timer setup 2023-06-28 11:12:18 +02:00
tick-internal.h
tick-legacy.c
tick-oneshot.c
tick-sched.c tick/rcu: Fix false positive "softirq work is pending" messages 2023-09-13 09:42:57 +02:00
tick-sched.h
time.c
time_test.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c timekeeping: Fix references to nonexistent ktime_get_fast_ns() 2023-05-11 23:03:35 +09:00
timekeeping.h
timekeeping_debug.c
timekeeping_internal.h
timer.c
timer_list.c
vsyscall.c