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

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

Merge "sched/walt: Improve the scheduler"

parents a3ebedb4 fe35672a
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -8195,6 +8195,27 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
		return 0;
	}

#ifdef CONFIG_SCHED_WALT
	if ((env->idle == CPU_NEWLY_IDLE) &&
		is_min_capacity_cpu(env->dst_cpu) &&
		!is_min_capacity_cpu(env->src_cpu) &&
		walt_get_rtg_status(p)) {
		bool pull_to_silver_allowed = false;
		unsigned int cpu;

		for_each_cpu(cpu, env->cpus) {
			if (!is_min_capacity_cpu(cpu) &&
				cpu_overutilized(cpu)) {
				pull_to_silver_allowed = true;
				break;
			}
		}

		if (!pull_to_silver_allowed)
			return 0;
	}
#endif

	/*
	 * Aggressive migration if:
	 * 1) IDLE or NEWLY_IDLE balance.