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

Commit 89162be6 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

sched: improve the scheduler



This change is for general scheduler improvement.

Change-Id: Idb019614ff31b3cfcde023cd92f8d791f2650dee
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 62433a08
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -3853,7 +3853,7 @@ struct find_best_target_env {

static inline void adjust_cpus_for_packing(struct task_struct *p,
			int *target_cpu, int *best_idle_cpu,
			int target_cpus_count,
			int target_cpus_count, int shallowest_idle_cstate,
			struct find_best_target_env *fbt_env,
			bool boosted)
{
@@ -3863,7 +3863,7 @@ static inline void adjust_cpus_for_packing(struct task_struct *p,
		return;

	if (task_placement_boost_enabled(p) || fbt_env->need_idle || boosted ||
			idle_get_state_idx(cpu_rq(*best_idle_cpu)) == -1) {
			shallowest_idle_cstate == -1) {
		*target_cpu = -1;
		return;
	}
@@ -3884,8 +3884,13 @@ static inline void adjust_cpus_for_packing(struct task_struct *p,
	 * If there is only one active CPU and it is already above its current
	 * capacity, avoid placing additional task on the CPU.
	 */
	if (estimated_capacity > capacity_curr_of(*target_cpu))
	if (estimated_capacity > capacity_curr_of(*target_cpu)) {
		*target_cpu = -1;
		return;
	}

	if (fbt_env->rtg_target)
		*best_idle_cpu = -1;
}

static inline void update_misfit_status(struct task_struct *p, struct rq *rq)
@@ -7075,8 +7080,8 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
	} while (sg = sg->next, sg != start_sd->groups);

	adjust_cpus_for_packing(p, &target_cpu, &best_idle_cpu,
				active_cpus_count, fbt_env,
				boosted);
				active_cpus_count, shallowest_idle_cstate,
				fbt_env, boosted);

	/*
	 * For non latency sensitive tasks, cases B and C in the previous loop,