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

Commit 0d91facc authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: walt: Derive sched_smp_overlap_capacity from the energy-model



The energy-model indicates the OPP at which spreading the tasks across
cluster is beneficial for power. This OPP would be the overlapping
point of the power curves of the lower and higher clusters. Derive
the sched_smp_overlap_capacity to the capacity corresponding to such
overlapping point. No such overlapping point exists on a big.LITTLE
system.

Change-Id: I75686597042726a6c91c4403903d919a67bce880
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 1fd5d126
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6819,7 +6819,7 @@ is_packing_eligible(struct task_struct *p, unsigned long task_util,
	return cpu_cap_idx_pack == cpu_cap_idx_spread;
}

static unsigned int sched_smp_overlap_capacity = SCHED_CAPACITY_SCALE;
unsigned int sched_smp_overlap_capacity = SCHED_CAPACITY_SCALE;

static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync)
{
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ struct rq;
struct cpuidle_state;

extern __read_mostly bool sched_predl;
extern unsigned int sched_smp_overlap_capacity;

#ifdef CONFIG_SCHED_WALT
extern unsigned int sched_ravg_window;
+20 −2
Original line number Diff line number Diff line
@@ -2179,7 +2179,7 @@ static void sort_clusters(void)
void walt_sched_energy_populated_callback(void)
{
	struct sched_cluster *cluster;
	int prev_max = 0;
	int prev_max = 0, next_min = 0;

	mutex_lock(&cluster_lock);

@@ -2201,8 +2201,26 @@ void walt_sched_energy_populated_callback(void)
		 * clusters on a big.LITTLE system.
		 */
		sysctl_sched_is_big_little = 0;
		next_min = cluster->min_power_cost;
	}

	/*
	 * Find the OPP at which the lower power cluster
	 * power is overlapping with the next cluster.
	 */
	if (!sysctl_sched_is_big_little) {
		int cpu = cluster_first_cpu(sched_cluster[0]);
		struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL1];
		int i;

		for (i = 1; i < sge->nr_cap_states; i++) {
			if (sge->cap_states[i].power >= next_min) {
				sched_smp_overlap_capacity =
						sge->cap_states[i-1].cap;
				break;
			}
		}
	}

	mutex_unlock(&cluster_lock);
}