From 60e98ef37d3dced444cc63c6fab08f76c4e75aee Mon Sep 17 00:00:00 2001 From: libo Date: Fri, 13 Jul 2018 10:20:59 +0800 Subject: [PATCH] wifi: softirq: reduce ksoftirqd scheduled rate to improve TCP throughtput PD#162113: improve ap62x8 rx tput The reason why wifi TCP rx throughtput lower than kernel3.14 are as flollows: On K3.14, RX has more time to work in ISR, but on K4.9, RX has more time to work in kernel ksoftirqd thread, however, ksoftirqd has a very low priority. On K4.9, a commit from upstream caused this difference, then revert it. Revert "softirq: Let ksoftirqd do its job" This reverts commit 4cd13c21b207e80ddb1144c576500098f2d5f882. Change-Id: I094232dad5dfddbcd94c35ec42a5e3302ed52459 Signed-off-by: libo --- kernel/softirq.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 8c832fb..9c672ba 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -27,6 +27,10 @@ #include #include +#ifndef CONFIG_AMLOGIC_MODIFY +#define KSOFTIRQD_HIGH_RATE +#endif + #define CREATE_TRACE_POINTS #include @@ -81,12 +85,14 @@ 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. */ +#ifdef KSOFTIRQD_HIGH_RATE static bool ksoftirqd_running(void) { struct task_struct *tsk = __this_cpu_read(ksoftirqd); return tsk && (tsk->state == TASK_RUNNING); } +#endif /* * preempt_count and SOFTIRQ_OFFSET usage: @@ -335,8 +341,13 @@ asmlinkage __visible void do_softirq(void) pending = local_softirq_pending(); - if (pending && !ksoftirqd_running()) +#ifdef KSOFTIRQD_HIGH_RATE + if (pending && !ksoftirqd_running()) { +#else + if (pending) { +#endif do_softirq_own_stack(); + } local_irq_restore(flags); } @@ -362,9 +373,10 @@ void irq_enter(void) static inline void invoke_softirq(void) { +#ifdef KSOFTIRQD_HIGH_RATE if (ksoftirqd_running()) return; - +#endif if (!force_irqthreads) { #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK /* -- 2.7.4