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

Commit 44843c43 authored by Sai Harshini Nimmala's avatar Sai Harshini Nimmala
Browse files

sched/walt: Improve the scheduler



This change is for general scheduler improvement.

Change-Id: I33e9ec890f8b54d673770d5d02dba489a8e08ce7
Signed-off-by: default avatarSai Harshini Nimmala <snimmala@codeaurora.org>
parent b9173741
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -825,7 +825,7 @@ struct task_struct {
	struct list_head grp_list;
	u64 cpu_cycles;
	bool misfit;
	u8 unfilter;
	u32 unfilter;
#endif

#ifdef CONFIG_CGROUP_SCHED
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ extern unsigned int sysctl_sched_min_task_util_for_boost;
extern unsigned int sysctl_sched_min_task_util_for_colocation;
extern unsigned int sysctl_sched_asym_cap_sibling_freq_match_pct;
extern unsigned int sysctl_sched_coloc_downmigrate_ns;
extern unsigned int sysctl_sched_task_unfilter_nr_windows;
extern unsigned int sysctl_sched_task_unfilter_period;
extern unsigned int sysctl_sched_busy_hyst_enable_cpus;
extern unsigned int sysctl_sched_busy_hyst;
extern unsigned int sysctl_sched_coloc_busy_hyst_enable_cpus;
+2 −2
Original line number Diff line number Diff line
@@ -1234,7 +1234,7 @@ TRACE_EVENT(sched_task_util,
		__field(bool,		is_rtg)
		__field(bool,		rtg_skip_min)
		__field(int,		start_cpu)
		__field(int,		unfilter)
		__field(u32,		unfilter)
	),

	TP_fast_assign(
@@ -1260,7 +1260,7 @@ TRACE_EVENT(sched_task_util,
#endif
	),

	TP_printk("pid=%d comm=%s util=%lu prev_cpu=%d candidates=%#lx best_energy_cpu=%d sync=%d need_idle=%d fastpath=%d placement_boost=%d latency=%llu stune_boosted=%d is_rtg=%d rtg_skip_min=%d start_cpu=%d unfilter=%d",
	TP_printk("pid=%d comm=%s util=%lu prev_cpu=%d candidates=%#lx best_energy_cpu=%d sync=%d need_idle=%d fastpath=%d placement_boost=%d latency=%llu stune_boosted=%d is_rtg=%d rtg_skip_min=%d start_cpu=%d unfilter=%u",
		__entry->pid, __entry->comm, __entry->util, __entry->prev_cpu,
		__entry->candidates, __entry->best_energy_cpu, __entry->sync,
		__entry->need_idle, __entry->fastpath, __entry->placement_boost,
+5 −5
Original line number Diff line number Diff line
@@ -1791,7 +1791,7 @@ account_busy_for_task_demand(struct rq *rq, struct task_struct *p, int event)
	return 1;
}

unsigned int sysctl_sched_task_unfilter_nr_windows = 10;
unsigned int sysctl_sched_task_unfilter_period = 200000000;

/*
 * Called when new window is starting for a task, to record cpu usage over
@@ -1874,11 +1874,11 @@ static void update_history(struct rq *rq, struct task_struct *p,
	p->ravg.pred_demand_scaled = pred_demand_scaled;

	if (demand_scaled > sched_task_filter_util)
		p->unfilter = sysctl_sched_task_unfilter_nr_windows;
		p->unfilter = sysctl_sched_task_unfilter_period;
	else
		if (p->unfilter)
			p->unfilter = p->unfilter - 1;

			p->unfilter = max_t(int, 0,
				p->unfilter - p->ravg.last_win_size);
done:
	trace_sched_update_history(rq, p, runtime, samples, event);
}
@@ -2160,7 +2160,7 @@ void init_new_task_load(struct task_struct *p)
	for (i = 0; i < RAVG_HIST_SIZE_MAX; ++i)
		p->ravg.sum_history[i] = init_load_windows;
	p->misfit = false;
	p->unfilter = sysctl_sched_task_unfilter_nr_windows;
	p->unfilter = sysctl_sched_task_unfilter_period;
}

/*
+4 −3
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ static int ten_thousand = 10000;
static int six_hundred_forty_kb = 640 * 1024;
#endif
static int two_hundred_fifty_five = 255;
static int __maybe_unused two_hundred_million = 200000000;

#ifdef CONFIG_SCHED_WALT
const int sched_user_hint_max = 1000;
@@ -458,13 +459,13 @@ static struct ctl_table kern_table[] = {
		.proc_handler	= proc_douintvec_minmax,
	},
	{
		.procname	= "sched_task_unfilter_nr_windows",
		.data		= &sysctl_sched_task_unfilter_nr_windows,
		.procname	= "sched_task_unfilter_period",
		.data		= &sysctl_sched_task_unfilter_period,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler   = proc_dointvec_minmax,
		.extra1         = &one,
		.extra2		= &two_hundred_fifty_five,
		.extra2		= &two_hundred_million,
	},
	{
		.procname	= "sched_busy_hysteresis_enable_cpus",