mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
sched/walt: Improve the scheduler
This change is for general scheduler improvement. Change-Id: Ic5929726768f6a9ca2a5823e2795eeb5e172d93a Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org> Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
parent
e611070ee2
commit
822a7c683b
|
|
@ -66,6 +66,7 @@ unsigned int sysctl_panic_on_walt_bug;
|
|||
unsigned int sysctl_sched_suppress_region2;
|
||||
unsigned int sysctl_sched_skip_sp_newly_idle_lb = 1;
|
||||
unsigned int sysctl_sched_hyst_min_coloc_ns = 80000000;
|
||||
unsigned int sysctl_sched_asymcap_boost;
|
||||
|
||||
/* range is [1 .. INT_MAX] */
|
||||
static int sysctl_task_read_pid = 1;
|
||||
|
|
@ -859,6 +860,15 @@ struct ctl_table walt_table[] = {
|
|||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE,
|
||||
},
|
||||
{
|
||||
.procname = "sched_asymcap_boost",
|
||||
.data = &sysctl_sched_asymcap_boost,
|
||||
.maxlen = sizeof(unsigned int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_douintvec_minmax,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE,
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -292,6 +292,7 @@ extern unsigned int sysctl_sched_sync_hint_enable;
|
|||
extern unsigned int sysctl_sched_bug_on_rt_throttle;
|
||||
extern unsigned int sysctl_sched_suppress_region2;
|
||||
extern unsigned int sysctl_sched_skip_sp_newly_idle_lb;
|
||||
extern unsigned int sysctl_sched_asymcap_boost;
|
||||
extern struct ctl_table walt_table[];
|
||||
extern struct ctl_table walt_base_table[];
|
||||
extern void walt_tunables(void);
|
||||
|
|
@ -909,6 +910,8 @@ void walt_lb_tick(struct rq *rq);
|
|||
extern __read_mostly unsigned int walt_scale_demand_divisor;
|
||||
#define scale_demand(d) ((d)/walt_scale_demand_divisor)
|
||||
|
||||
#define ASYMCAP_BOOST(cpu) (sysctl_sched_asymcap_boost && !is_min_capacity_cpu(cpu))
|
||||
|
||||
void create_util_to_cost(void);
|
||||
struct compute_energy_output {
|
||||
unsigned long sum_util[MAX_CLUSTERS];
|
||||
|
|
|
|||
|
|
@ -187,6 +187,10 @@ static void walt_get_indicies(struct task_struct *p, int *order_index,
|
|||
walt_task_skip_min_cpu(p)) {
|
||||
*energy_eval_needed = false;
|
||||
*order_index = 1;
|
||||
if (sysctl_sched_asymcap_boost) {
|
||||
*end_index = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = *order_index ; i < num_sched_clusters - 1; i++) {
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ static int walt_lb_find_busiest_higher_cap_cpu(int dst_cpu, const cpumask_t *src
|
|||
unsigned long total_capacity = 0, total_util = 0, total_nr = 0;
|
||||
int total_cpus = 0;
|
||||
struct walt_rq *wrq;
|
||||
|
||||
bool asymcap_boost = ASYMCAP_BOOST(dst_cpu);
|
||||
for_each_cpu(i, src_mask) {
|
||||
|
||||
if (!cpu_active(i))
|
||||
|
|
@ -384,7 +384,8 @@ static int walt_lb_find_busiest_higher_cap_cpu(int dst_cpu, const cpumask_t *src
|
|||
* overutilized but for rotation, we have to
|
||||
* spread out.
|
||||
*/
|
||||
if (!walt_rotation_enabled && !cpu_overutilized(i))
|
||||
if (!walt_rotation_enabled && !cpu_overutilized(i) &&
|
||||
!asymcap_boost)
|
||||
continue;
|
||||
|
||||
if (util < busiest_util)
|
||||
|
|
@ -398,7 +399,7 @@ static int walt_lb_find_busiest_higher_cap_cpu(int dst_cpu, const cpumask_t *src
|
|||
* Don't allow migrating to lower cluster unless this high
|
||||
* capacity cluster is sufficiently loaded.
|
||||
*/
|
||||
if (!walt_rotation_enabled) {
|
||||
if (!walt_rotation_enabled && !asymcap_boost) {
|
||||
if (total_nr <= total_cpus || total_util * 1280 < total_capacity * 1024)
|
||||
busiest_cpu = -1;
|
||||
}
|
||||
|
|
@ -449,7 +450,8 @@ static int walt_lb_find_busiest_lower_cap_cpu(int dst_cpu, const cpumask_t *src_
|
|||
(!wrq->walt_stats.nr_big_tasks || !available_idle_cpu(dst_cpu)))
|
||||
continue;
|
||||
|
||||
if (!walt_rotation_enabled && !cpu_overutilized(i))
|
||||
if (!walt_rotation_enabled && !cpu_overutilized(i) &&
|
||||
!ASYMCAP_BOOST(i))
|
||||
continue;
|
||||
|
||||
if (util < busiest_util)
|
||||
|
|
@ -460,7 +462,8 @@ static int walt_lb_find_busiest_lower_cap_cpu(int dst_cpu, const cpumask_t *src_
|
|||
busy_nr_big_tasks = wrq->walt_stats.nr_big_tasks;
|
||||
}
|
||||
|
||||
if (!walt_rotation_enabled && !busy_nr_big_tasks) {
|
||||
if (!walt_rotation_enabled && !busy_nr_big_tasks &&
|
||||
!(busiest_cpu != -1 && ASYMCAP_BOOST(busiest_cpu))) {
|
||||
if (total_nr <= total_cpus || total_util * 1280 < total_capacity * 1024)
|
||||
busiest_cpu = -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user