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

Commit eb329acd authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Satya Durga Srinivasu Prabhala
Browse files

sched/fair: reduce no-hz idle balance for energy aware systems



We are kicking no-hz idle balance when the CPU has two tasks.
It should be done only when the CPU is overutilized on
energy aware systems. This approach seems to be causing more
number of wakeups on HZ=250 systems compared to HZ=100.

Revisit the no-hz idle scheme and only send the IPI if and
when it is necessary.

Change-Id: I82e58a2aa3b6508c86d05c93c9fb7fe6dfbde500
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
[satyap@codeaurora.org: fix trivial merge conflicts]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 2fdb6c48
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -10615,7 +10615,7 @@ static inline int find_energy_aware_new_ilb(void)
	int ilb = nr_cpu_ids;
	struct sched_domain *sd;
	int cpu = raw_smp_processor_id();
	cpumask_t avail_cpus, tmp_cpus;
	cpumask_t idle_cpus, tmp_cpus;
	struct sched_group *sg;
	unsigned long ref_cap = capacity_orig_of(cpu);
	unsigned long best_cap = 0, best_cap_cpu = -1;
@@ -10625,16 +10625,16 @@ static inline int find_energy_aware_new_ilb(void)
	if (!sd)
		goto out;

	cpumask_and(&avail_cpus, nohz.idle_cpus_mask,
	cpumask_and(&idle_cpus, nohz.idle_cpus_mask,
			housekeeping_cpumask(HK_FLAG_MISC));
	cpumask_andnot(&avail_cpus, &avail_cpus, cpu_isolated_mask);
	cpumask_andnot(&idle_cpus, &idle_cpus, cpu_isolated_mask);

	sg = sd->groups;
	do {
		int i;
		unsigned long cap;

		cpumask_and(&tmp_cpus, &avail_cpus, sched_group_span(sg));
		cpumask_and(&tmp_cpus, &idle_cpus, sched_group_span(sg));
		i = cpumask_first(&tmp_cpus);

		/* This sg did not have any idle CPUs */
@@ -10649,7 +10649,18 @@ static inline int find_energy_aware_new_ilb(void)
			break;
		}

		/* The back up CPU is selected from the best capacity CPUs */
		/*
		 * When there are no idle CPUs in the same capacity group,
		 * we find the next best capacity CPU.
		 */
		if (best_cap > ref_cap) {
			if (cap > ref_cap && cap < best_cap) {
				best_cap = cap;
				best_cap_cpu = i;
			}
			continue;
		}

		if (cap > best_cap) {
			best_cap = cap;
			best_cap_cpu = i;