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

Commit 72b68664 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: Take downmigrate threshold into consideration



If the tasks are run on the higher capacity cluster solely due to the
reason that they can not be be fit in the lower capacity cluster, the
downmigrate threshold prevents the frequent tasks migrations between
the clusters.

Change-Id: I234a23ffd907c2476c94d5f6227dab1bb6c9bebb
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 3b14c88e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1268,6 +1268,18 @@ CPU across all clusters. When this tunable is enabled, the RT tasks are
restricted to the lowest possible power cluster.


*** 7.25 sched_downmigrate

Appears at: /proc/sys/kernel/sched_downmigrate

Default value: 60

This tunable is a percentage. It exists to control hysteresis. Lets say a task
migrated to a high-performance cpu when it crossed 80% demand on a
power-efficient cpu. We don't let it come back to a power-efficient cpu until
its demand *in reference to the power-efficient cpu* drops less than 60%
(sched_downmigrate).

=========================
8. HMP SCHEDULER TRACE POINTS
=========================
+7 −1
Original line number Diff line number Diff line
@@ -2739,13 +2739,19 @@ done:

static int task_load_will_fit(struct task_struct *p, u64 task_load, int cpu)
{
	int upmigrate;

	if (cpu_capacity(cpu) == max_capacity)
		return 1;

	if (task_nice(p) > sched_upmigrate_min_nice || upmigrate_discouraged(p))
		return 1;

	if (task_load < sched_upmigrate)
	upmigrate = sched_upmigrate;
	if (cpu_capacity(task_cpu(p)) > cpu_capacity(cpu))
		upmigrate = sched_downmigrate;

	if (task_load < upmigrate)
		return 1;

	return 0;