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 4cd13c21b2.

Change-Id: I094232dad5dfddbcd94c35ec42a5e3302ed52459
Signed-off-by: libo <bo.li@amlogic.com>
This commit is contained in:
libo
2018-07-13 10:20:59 +08:00
committed by Bo Li
parent 345436f394
commit 60e98ef37d

View File

@@ -27,6 +27,10 @@
#include <linux/tick.h>
#include <linux/irq.h>
#ifndef CONFIG_AMLOGIC_MODIFY
#define KSOFTIRQD_HIGH_RATE
#endif
#define CREATE_TRACE_POINTS
#include <trace/events/irq.h>
@@ -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
/*