From d6592588edada6ae0430d320c8e129e5389d1aaa Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 18 Dec 2020 14:37:04 +0100 Subject: [PATCH] Revert "ANDROID: Revert "Mark HI and TASKLET softirq synchronous"" This reverts commit ea05d25c786ec5883f05616c4243e6abf41c8947 as the softirq code is rewritten in 5.11-rc1 and massive merge conflicts are happening. If this change is still needed, please work with upstream to get the patches accepted so they can then come into this tree automatically. Bug: 168521633 Cc: Satya Durga Srinivasu Prabhala Cc: J. Avila Signed-off-by: Greg Kroah-Hartman Change-Id: I4ab5adcf06824b0b7d052ea07e8c851c9052fe6b --- kernel/softirq.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index a5ddc66d341d..a7956c5d55e4 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -88,12 +88,16 @@ static void wakeup_softirqd(void) /* * If ksoftirqd is scheduled, we do not want to process pending softirqs - * right now. Let ksoftirqd handle this at its own rate, to get fairness. + * right now. Let ksoftirqd handle this at its own rate, to get fairness, + * unless we're doing some of the synchronous softirqs. */ -static bool ksoftirqd_running(void) +#define SOFTIRQ_NOW_MASK ((1 << HI_SOFTIRQ) | (1 << TASKLET_SOFTIRQ)) +static bool ksoftirqd_running(unsigned long pending) { struct task_struct *tsk = __this_cpu_read(ksoftirqd); + if (pending & SOFTIRQ_NOW_MASK) + return false; return tsk && (tsk->state == TASK_RUNNING) && !__kthread_should_park(tsk); } @@ -362,7 +366,7 @@ asmlinkage __visible void do_softirq(void) pending = local_softirq_pending(); - if (pending && !ksoftirqd_running()) + if (pending && !ksoftirqd_running(pending)) do_softirq_own_stack(); local_irq_restore(flags); @@ -396,7 +400,7 @@ void irq_enter(void) static inline void invoke_softirq(void) { - if (ksoftirqd_running()) + if (ksoftirqd_running(local_softirq_pending())) return; if (!force_irqthreads) {