sched/walt: Improve the scheduler

This change is for general scheduler improvement.

Change-Id: Ife8de1eee2b7aa862979073c075466c97ba980e3
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:
Abhijeet Dharmapurikar 2021-04-27 17:50:56 -07:00 committed by Rishabh Bhatnagar
parent 216e06f3dd
commit b07ef98a47
3 changed files with 6 additions and 6 deletions

View File

@ -189,7 +189,7 @@ int sched_busy_hyst_handler(struct ctl_table *table, int write,
*
* Update average with latest nr_running value for CPU
*/
void sched_update_nr_prod(int cpu, bool enq)
void sched_update_nr_prod(int cpu, int enq)
{
u64 diff;
u64 curr_time;
@ -201,7 +201,7 @@ void sched_update_nr_prod(int cpu, bool enq)
diff = curr_time - per_cpu(last_time, cpu);
BUG_ON((s64)diff < 0);
per_cpu(last_time, cpu) = curr_time;
per_cpu(nr, cpu) = cpu_rq(cpu)->nr_running;
per_cpu(nr, cpu) = cpu_rq(cpu)->nr_running + enq;
if (per_cpu(nr, cpu) > per_cpu(nr_max, cpu))
per_cpu(nr_max, cpu) = per_cpu(nr, cpu);

View File

@ -3764,7 +3764,7 @@ static void android_rvh_enqueue_task(void *unused, struct rq *rq, struct task_st
if (unlikely(walt_disabled))
return;
wts->last_enqueued_ts = wallclock;
sched_update_nr_prod(rq->cpu, true);
sched_update_nr_prod(rq->cpu, 1);
if (walt_fair_task(p)) {
wts->misfit = !task_fits_max(p, rq->cpu);
@ -3784,7 +3784,7 @@ static void android_rvh_dequeue_task(void *unused, struct rq *rq, struct task_st
if (p == wrq->ed_task)
is_ed_task_present(rq, sched_ktime_clock(), p);
sched_update_nr_prod(rq->cpu, false);
sched_update_nr_prod(rq->cpu, -1);
if (walt_fair_task(p))
dec_rq_walt_stats(rq, p);
@ -3823,7 +3823,7 @@ static void android_rvh_update_misfit_status(void *unused, struct task_struct *p
change = misfit - old_misfit;
if (change) {
sched_update_nr_prod(rq->cpu, true);
sched_update_nr_prod(rq->cpu, 0);
wts->misfit = misfit;
wrq->walt_stats.nr_big_tasks += change;
BUG_ON(wrq->walt_stats.nr_big_tasks < 0);

View File

@ -147,7 +147,7 @@ extern unsigned int sched_capacity_margin_down[WALT_NR_CPUS];
extern cpumask_t asym_cap_sibling_cpus;
extern cpumask_t __read_mostly **cpu_array;
extern void sched_update_nr_prod(int cpu, bool enq);
extern void sched_update_nr_prod(int cpu, int enq);
extern unsigned int walt_big_tasks(int cpu);
extern void walt_rotate_work_init(void);
extern void walt_rotation_checkpoint(int nr_big);