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

Commit 7a8045df 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 6c24075f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ extern unsigned int __weak sysctl_sched_ravg_window_nr_ticks;
extern unsigned int __weak sysctl_sched_many_wakeup_threshold;
extern unsigned int __weak 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
@@ -133,6 +133,7 @@ unsigned int sched_capacity_margin_down[NR_CPUS] = {

#ifdef CONFIG_SCHED_WALT
__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;

@@ -4066,6 +4067,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
		}
+6 −0
Original line number Diff line number Diff line
@@ -2991,6 +2991,12 @@ static inline bool task_in_related_thread_group(struct task_struct *p)
	return (rcu_access_pointer(p->wts.grp) != NULL);
}

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);
}

static inline struct walt_related_thread_group
*task_related_thread_group(struct task_struct *p)
{
+18 −0
Original line number Diff line number Diff line
@@ -150,6 +150,15 @@ const int sched_user_hint_max = 1000;
static unsigned int ns_per_sec = NSEC_PER_SEC;
static unsigned int one_hundred_thousand = 100000;
static unsigned int two_hundred_million = 200000000;
/*
 * 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 */
@@ -545,6 +554,15 @@ static struct ctl_table kern_table[] = {
		.extra1		= SYSCTL_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
	{