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

Commit 67e9f6f8 authored by Tengfei Fan's avatar Tengfei Fan Committed by Pavankumar Kondeti
Browse files

sched/walt: Improve the scheduler



This change is for general scheduler improvement.

Change-Id: If03bf5f104740adf09d854837ae9b141dc97cbc6
Signed-off-by: default avatarTengfei Fan <tengfeif@codeaurora.org>
[pkondeti@codeaurora: Added tunable based on priority]
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent e3e20132
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ extern unsigned int sysctl_sched_window_stats_policy;
extern unsigned int sysctl_sched_ravg_window_nr_ticks;
extern unsigned int sysctl_sched_dynamic_ravg_window_enable;
extern unsigned int sysctl_sched_prefer_spread;
extern unsigned int sysctl_walt_rtg_cfs_boost_prio;

extern int
walt_proc_group_thresholds_handler(struct ctl_table *table, int write,
+6 −0
Original line number Diff line number Diff line
@@ -176,6 +176,7 @@ unsigned int sysctl_sched_min_task_util_for_boost = 51;
/* 0.68ms default for 20ms window size scaled to 1024 */
unsigned int sysctl_sched_min_task_util_for_colocation = 35;
__read_mostly unsigned int sysctl_sched_prefer_spread;
unsigned int sysctl_walt_rtg_cfs_boost_prio = 99; /* disabled by default */
#endif
unsigned int sched_small_task_threshold = 102;

@@ -4136,6 +4137,11 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
				se->vruntime = min_vruntime(vruntime,
							se->vruntime);
				return;
			} else if (task_rtg_high_prio(task_of(se))) {
				vruntime -= thresh;
				se->vruntime = min_vruntime(vruntime,
							se->vruntime);
				return;
			}
#endif
		}
+11 −0
Original line number Diff line number Diff line
@@ -2896,6 +2896,12 @@ struct related_thread_group *task_related_thread_group(struct task_struct *p)
	return rcu_dereference(p->grp);
}

static inline bool task_rtg_high_prio(struct task_struct *p)
{
	return task_in_related_thread_group(p) &&
		(p->prio <= sysctl_walt_rtg_cfs_boost_prio);
}

/* Is frequency of two cpus synchronized with each other? */
static inline int same_freq_domain(int src_cpu, int dst_cpu)
{
@@ -3130,6 +3136,11 @@ struct related_thread_group *task_related_thread_group(struct task_struct *p)
	return NULL;
}

static inline bool task_rtg_high_prio(struct task_struct *p)
{
	return false;
}

static inline u32 task_load(struct task_struct *p) { return 0; }
static inline u32 task_pl(struct task_struct *p) { return 0; }

+18 −0
Original line number Diff line number Diff line
@@ -148,6 +148,15 @@ static int __maybe_unused two_hundred_million = 200000000;
const int sched_user_hint_max = 1000;
static unsigned int ns_per_sec = NSEC_PER_SEC;
static unsigned int one_hundred_thousand = 100000;
/*
 * CFS task prio range is [100 ... 139]
 * 120 is the default prio.
 * RTG boost range is [100 ... 119] because giving
 * boost for [120 .. 139] does not make sense.
 * 99 means disabled and it is the default value.
 */
static unsigned int min_cfs_boost_prio = 99;
static unsigned int max_cfs_boost_prio = 119;
#endif
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
@@ -561,6 +570,15 @@ static struct ctl_table kern_table[] = {
		.extra1		= &zero,
		.extra2		= &two,
	},
	{
		.procname	= "walt_rtg_cfs_boost_prio",
		.data		= &sysctl_walt_rtg_cfs_boost_prio,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler   = proc_dointvec_minmax,
		.extra1		= &min_cfs_boost_prio,
		.extra2		= &max_cfs_boost_prio,
	},
#endif
#ifdef CONFIG_SCHED_DEBUG
	{