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

Commit b67caa7c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched/fair: Derive the downmigration margin wrt the destination CPU"

parents d23e4f5e 94fa18d7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -6870,11 +6870,12 @@ static void sched_update_down_migrate_values(int cap_margin_levels,

	if (cap_margin_levels > 1) {
		/*
		 * Skip first cluster as down migrate value isn't needed
		 * Skip last cluster as down migrate value isn't needed.
		 * Because there is no downmigration to it.
		 */
		for (i = 0; i < cap_margin_levels; i++)
			if (cluster_cpus[i+1])
				for_each_cpu(cpu, cluster_cpus[i+1])
			if (cluster_cpus[i])
				for_each_cpu(cpu, cluster_cpus[i])
					sched_capacity_margin_down[cpu] =
					sysctl_sched_capacity_margin_down[i];
	} else {
+5 −1
Original line number Diff line number Diff line
@@ -3892,8 +3892,12 @@ static inline bool task_fits_capacity(struct task_struct *p,
{
	unsigned int margin;

	/*
	 * Derive upmigration/downmigrate margin wrt the src/dest
	 * CPU.
	 */
	if (capacity_orig_of(task_cpu(p)) > capacity_orig_of(cpu))
		margin = sched_capacity_margin_down[task_cpu(p)];
		margin = sched_capacity_margin_down[cpu];
	else
		margin = sched_capacity_margin_up[task_cpu(p)];