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

Commit d3f96d21 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: Improve the scheduler



This change is for general scheduler improvement.

Change-Id: If1ee58a8ed59e4a9ee25dfa6fa2a1c1654e00e6d
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent c8928333
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ extern unsigned int sysctl_sched_cpu_high_irqload;
extern unsigned int sysctl_sched_boost;
extern unsigned int sysctl_sched_group_upmigrate_pct;
extern unsigned int sysctl_sched_group_downmigrate_pct;
extern unsigned int sysctl_sched_conservative_pl;
extern unsigned int sysctl_sched_many_wakeup_threshold;
extern unsigned int sysctl_sched_walt_rotate_big_tasks;
extern unsigned int sysctl_sched_min_task_util_for_boost;
+15 −2
Original line number Diff line number Diff line
@@ -161,6 +161,15 @@ static inline bool use_pelt(void)
#endif
}

static inline bool conservative_pl(void)
{
#ifdef CONFIG_SCHED_WALT
	return sysctl_sched_conservative_pl;
#else
	return false;
#endif
}

static unsigned long freq_to_util(struct sugov_policy *sg_policy,
				  unsigned int freq)
{
@@ -379,6 +388,7 @@ static void sugov_walt_adjust(struct sugov_cpu *sg_cpu, unsigned long *util,
	unsigned long nl = sg_cpu->walt_load.nl;
	unsigned long cpu_util = sg_cpu->util;
	bool is_hiload;
	unsigned long pl = sg_cpu->walt_load.pl;

	if (unlikely(!sysctl_sched_use_walt_cpu_util))
		return;
@@ -393,8 +403,11 @@ static void sugov_walt_adjust(struct sugov_cpu *sg_cpu, unsigned long *util,
	if (is_hiload && nl >= mult_frac(cpu_util, NL_RATIO, 100))
		*util = *max;

	if (sg_policy->tunables->pl)
		*util = max(*util, sg_cpu->walt_load.pl);
	if (sg_policy->tunables->pl) {
		if (conservative_pl())
			pl = mult_frac(pl, TARGET_LOAD, 100);
		*util = max(*util, pl);
	}
}

static void sugov_update_single(struct update_util_data *hook, u64 time,
+0 −1
Original line number Diff line number Diff line
@@ -2123,7 +2123,6 @@ cpu_util_freq_walt(int cpu, struct sched_walt_cpu_load *walt_load)

		nl = div64_u64(nl * (100 + boost),
		walt_cpu_util_freq_divisor);
		pl = div64_u64(pl * (100 + boost), 100);

		walt_load->prev_window_util = util;
		walt_load->nl = nl;
+1 −0
Original line number Diff line number Diff line
@@ -922,6 +922,7 @@ void set_window_start(struct rq *rq)
unsigned int max_possible_efficiency = 1;
unsigned int min_possible_efficiency = UINT_MAX;

unsigned int sysctl_sched_conservative_pl;
unsigned int sysctl_sched_many_wakeup_threshold = 1000;

#define INC_STEP 8
+9 −0
Original line number Diff line number Diff line
@@ -370,6 +370,15 @@ static struct ctl_table kern_table[] = {
		.extra1		= &neg_three,
		.extra2		= &three,
	},
	{
		.procname	= "sched_conservative_pl",
		.data		= &sysctl_sched_conservative_pl,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= &zero,
		.extra2		= &one,
	},
	{
		.procname	= "sched_many_wakeup_threshold",
		.data		= &sysctl_sched_many_wakeup_threshold,