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

Commit f83db1b5 authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa
Browse files

sched: improve the scheduler



This change is for general scheduler improvement.

Change-Id: I1f53c3b7daece8e0a9122f0b1a0ffde40d1d5cf1
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent 707a2ed2
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ __read_mostly unsigned int sysctl_sched_cpu_high_irqload = (10 * NSEC_PER_MSEC);
 * IMPORTANT: Initialize both copies to same value!!
 */

static __read_mostly bool sched_predl;

__read_mostly unsigned int sched_ravg_hist_size = 5;
__read_mostly unsigned int sysctl_sched_ravg_hist_size = 5;

@@ -231,6 +233,16 @@ static int __init set_sched_ravg_window(char *str)

early_param("sched_ravg_window", set_sched_ravg_window);

static int __init set_sched_predl(char *str)
{
	unsigned int predl;

	get_option(&str, &predl);
	sched_predl = !!predl;
	return 0;
}
early_param("sched_predl", set_sched_predl);

void inc_rq_hmp_stats(struct rq *rq, struct task_struct *p, int change_cra)
{
	inc_nr_big_task(&rq->hmp_stats, p);
@@ -1096,6 +1108,9 @@ void update_task_pred_demand(struct rq *rq, struct task_struct *p, int event)
{
	u32 new, old;

	if (!sched_predl)
		return;

	if (is_idle_task(p) || exiting_task(p))
		return;

@@ -1618,6 +1633,9 @@ static inline u32 predict_and_update_buckets(struct rq *rq,
	int bidx;
	u32 pred_demand;

	if (!sched_predl)
		return 0;

	bidx = busy_to_bucket(runtime);
	pred_demand = get_pred_busy(rq, p, bidx, runtime);
	bucket_increase(p->ravg.busy_buckets, bidx);