From 0e25c12f4e870e2c38d58efad72ae5300dd06f3d Mon Sep 17 00:00:00 2001 From: Lingutla Chandrasekhar Date: Thu, 1 Mar 2018 18:36:36 +0530 Subject: [PATCH] Revert "Revert "ANDROID: Revert "softirq: Let ksoftirqd do its job""" This reverts commit c646ea5a5fd9f1dad83111fbb5362418b36899a4, as the merge conflicts have been resolved. Bug: 168521633 Change-Id: Ide895e808fd0786b6690334d62d250f73584508e Signed-off-by: Lingutla Chandrasekhar [satyap@codeaurora.org: Fix trivial merge conflicts] Signed-off-by: Satya Durga Srinivasu Prabhala [elavila: Port to mainline] Signed-off-by: J. Avila Signed-off-by: Shaleen Agrawal --- kernel/softirq.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index a0fd37ba67f1..0ea9f90ed011 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -90,19 +90,6 @@ static void wakeup_softirqd(void) wake_up_process(tsk); } -/* - * 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. - */ -static bool ksoftirqd_running(void) -{ - struct task_struct *tsk = __this_cpu_read(ksoftirqd); - - if (pending & SOFTIRQ_NOW_MASK) - return false; - return tsk && task_is_running(tsk) && !__kthread_should_park(tsk); -} - #ifdef CONFIG_TRACE_IRQFLAGS DEFINE_PER_CPU(int, hardirqs_enabled); DEFINE_PER_CPU(int, hardirq_context); @@ -244,7 +231,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) goto out; pending = local_softirq_pending(); - if (!pending || ksoftirqd_running()) + if (!pending) goto out; /* @@ -427,9 +414,6 @@ static inline bool should_wake_ksoftirqd(void) static inline void invoke_softirq(void) { - if (ksoftirqd_running()) - return; - if (!force_irqthreads() || !__this_cpu_read(ksoftirqd)) { #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK /* @@ -463,7 +447,7 @@ asmlinkage __visible void do_softirq(void) pending = local_softirq_pending(); - if (pending && !ksoftirqd_running()) + if (pending) do_softirq_own_stack(); local_irq_restore(flags);