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

Commit 1fd5d126 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: Add provision to control the spreading on SMP



Spreading the tasks across CPUs in different groups/clusters
may hurt power on some SMP systems. Start spreading the tasks
only if all the CPUs in the first group/cluster are utilized
above sched_smp_overlap_capacity threshold. The subsequent
patches add support for deriving this threshold from the
energy-model for optimal power.

Change-Id: I1f77fd9424503166bde268e8e2a0131bbda5d125
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 649af694
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -6819,6 +6819,8 @@ 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;

static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync)
{
	struct sched_domain *sd;
@@ -7091,10 +7093,11 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync)

	/*
	 * If we don't find a CPU that fits this task without
	 * increasing OPP, expand the search to the other
	 * groups on a SMP system.
	 * increasing OPP above sched_smp_overlap_capacity,
	 * expand the search to the other groups on a SMP system.
	 */
	if (!sysctl_sched_is_big_little && target_cpu == -1) {
	if (!sysctl_sched_is_big_little && target_cpu == -1 &&
			min_util_cpu_util_cum > sched_smp_overlap_capacity) {
		if (sg_target->next != start_sg) {
			sg_target = sg_target->next;
			goto next_sg;