Commit 4351d230 authored by John Stultz's avatar John Stultz Committed by Treehugger Robot
Browse files

ANDROID: softirq: Fix missing wakeup_softirqd() in !CONFIG_RT_SOFTINT_OPTIMIZATION case



In commit 0578248b ("ANDROID: softirq: defer softirq
processing to ksoftirqd if CPU is busy with RT"), the patch tweaked
the logic as such:

__do_softirq(void)
        local_irq_disable();

        pending = local_softirq_pending();
+       deferred = softirq_deferred_for_rt(pending);
+
        if (pending) {
                if (time_before(jiffies, end) && !need_resched() &&
                    --max_restart)
                        goto restart;
-
-               wakeup_softirqd();
        }

+#ifdef CONFIG_RT_SOFTINT_OPTIMIZATION
+       if (pending | deferred)
+               wakeup_softirqd();
+#endif

The problem with the above, is in the case
!CONFIG_RT_SOFTINT_OPTIMIZATION, wakeup_softirqd() will not be called
when there is a pending local softirq.

This was originally raised by Qais Yousef <qyousef@google.com> but
had not been prioritized due to it being only a correctness issue
as CONFIG_RT_SOFTINT_OPTIMIZATION is enabled on Android kernels.

However, it was pointed out that on ARM32, _RT_SOFTINT_OPTIMIZATION
is disabled, and this was in fact causing errors of the sort:
  "NOHZ tick-stop error: Non-RCU local softirq work is pending..."

Bug: 261354911
Fixes: 0578248b ("ANDROID: softirq: defer softirq processing to ksoftirqd if CPU is busy with RT")
Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
Change-Id: I2b84811a2e7435e861304b22b0b0a63405a48bc8
parent 1e3329fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment