Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a73c96a authored by Srinath Sridharan's avatar Srinath Sridharan Committed by Dmitry Shmidt
Browse files

ANDROID: sched/walt: Accounting for number of irqs pending on each core



Schedules on a core whose irq count is less than a threshold.
Improves I/O performance of EAS.

Change-Id: I08ff7dd0d22502a0106fc636b1af2e6fe9e758b5
Signed-off-by: default avatarAndres Oportus <andresoportus@google.com>
parent 26c21548
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ extern unsigned int sysctl_sched_cstate_aware;
extern unsigned int sysctl_sched_use_walt_cpu_util;
extern unsigned int sysctl_sched_use_walt_task_util;
extern unsigned int sysctl_sched_walt_init_task_load_pct;
extern unsigned int sysctl_sched_walt_cpu_high_irqload;
#endif

enum sched_tunable_scaling {
+5 −0
Original line number Diff line number Diff line
@@ -7842,6 +7842,11 @@ void __init sched_init(void)
		rq->idle_stamp = 0;
		rq->avg_idle = 2*sysctl_sched_migration_cost;
		rq->max_idle_balance_cost = sysctl_sched_migration_cost;
#ifdef CONFIG_SCHED_WALT
		rq->cur_irqload = 0;
		rq->avg_irqload = 0;
		rq->irqload_ts = 0;
#endif

		INIT_LIST_HEAD(&rq->cfs_tasks);

+16 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#endif

#include "walt.h"

#ifdef CONFIG_IRQ_TIME_ACCOUNTING

@@ -46,11 +46,18 @@ void irqtime_account_irq(struct task_struct *curr)
	struct irqtime *irqtime = this_cpu_ptr(&cpu_irqtime);
	s64 delta;
	int cpu;
#ifdef CONFIG_SCHED_WALT
	u64 wallclock;
	bool account = true;
#endif

	if (!sched_clock_irqtime)
		return;

	cpu = smp_processor_id();
#ifdef CONFIG_SCHED_WALT
	wallclock = sched_clock_cpu(cpu);
#endif
	delta = sched_clock_cpu(cpu) - irqtime->irq_start_time;
	irqtime->irq_start_time += delta;

@@ -65,8 +72,16 @@ void irqtime_account_irq(struct task_struct *curr)
		irqtime->hardirq_time += delta;
	else if (in_serving_softirq() && curr != this_cpu_ksoftirqd())
		irqtime->softirq_time += delta;
#ifdef CONFIG_SCHED_WALT
	else
		account = false;
#endif

	u64_stats_update_end(&irqtime->sync);
#ifdef CONFIG_SCHED_WALT
	if (account)
		walt_account_irqtime(cpu, curr, delta, wallclock);
#endif
}
EXPORT_SYMBOL_GPL(irqtime_account_irq);

+6 −1
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ unsigned int sysctl_sched_cstate_aware = 1;
#ifdef CONFIG_SCHED_WALT
unsigned int sysctl_sched_use_walt_cpu_util = 1;
unsigned int sysctl_sched_use_walt_task_util = 1;
__read_mostly unsigned int sysctl_sched_walt_cpu_high_irqload =
    (10 * NSEC_PER_MSEC);
#endif
/*
 * The initial- and re-scaling of tunables is configurable
@@ -4653,7 +4655,6 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
	schedtune_enqueue_task(p, cpu_of(rq));

#endif /* CONFIG_SMP */

	hrtick_update(rq);
}

@@ -6327,6 +6328,10 @@ static inline int find_best_target(struct task_struct *p, bool boosted)
		if (new_util > capacity_orig_of(i))
			continue;

#ifdef CONFIG_SCHED_WALT
		if (walt_cpu_high_irqload(i))
			continue;
#endif
		/*
		 * For boosted tasks we favor idle cpus unconditionally to
		 * improve latency.
+3 −0
Original line number Diff line number Diff line
@@ -713,6 +713,9 @@ struct rq {
	u64 prev_runnable_sum;
	u64 nt_curr_runnable_sum;
	u64 nt_prev_runnable_sum;
	u64 cur_irqload;
	u64 avg_irqload;
	u64 irqload_ts;
#endif /* CONFIG_SCHED_WALT */


Loading