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

Commit a553d2e5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: Add load based placement for RT tasks"

parents 4d58cfa9 1f6fff35
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -9251,7 +9251,7 @@ no_move:
				stop_one_cpu_nowait(cpu_of(busiest),
					active_load_balance_cpu_stop, busiest,
					&busiest->active_balance_work);
				ld_moved++;
				*continue_balancing = 0;
			}

			/*
@@ -9462,9 +9462,12 @@ static int idle_balance(struct rq *this_rq)

		/*
		 * Stop searching for tasks to pull if there are
		 * now runnable tasks on the balance rq.
		 * now runnable tasks on the balance rq or if
		 * continue_balancing has been unset (only possible
		 * due to active migration).
		 */
		if (pulled_task || balance_rq->nr_running > 0)
		if (pulled_task || balance_rq->nr_running > 0 ||
						!continue_balancing)
			break;
	}
	rcu_read_unlock();
+17 −1
Original line number Diff line number Diff line
@@ -1631,6 +1631,7 @@ static int find_lowest_rq_hmp(struct task_struct *task)
{
	struct cpumask *lowest_mask = __get_cpu_var(local_cpu_mask);
	int cpu_cost, min_cost = INT_MAX;
	u64 cpu_load, min_load = ULLONG_MAX;
	int best_cpu = -1;
	int i;

@@ -1664,11 +1665,26 @@ static int find_lowest_rq_hmp(struct task_struct *task)
		if (sched_boost() && capacity(rq) != max_capacity)
			continue;

		if (cpu_cost < min_cost && !sched_cpu_high_irqload(i)) {
		if (power_delta_exceeded(cpu_cost, min_cost)) {
			if (cpu_cost > min_cost)
				continue;

			min_cost = cpu_cost;
			min_load = ULLONG_MAX;
			best_cpu = -1;
		}

		if (sched_cpu_high_irqload(i))
			continue;

		cpu_load = scale_load_to_cpu(
				rq->hmp_stats.cumulative_runnable_avg, i);
		if (cpu_load < min_load) {
			min_load = cpu_load;
			best_cpu = i;
		}
	}

	return best_cpu;
}

+1 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,7 @@ extern void check_for_migration(struct rq *rq, struct task_struct *p);
extern void pre_big_small_task_count_change(const struct cpumask *cpus);
extern void post_big_small_task_count_change(const struct cpumask *cpus);
extern void set_hmp_defaults(void);
extern int power_delta_exceeded(unsigned int cpu_cost, unsigned int base_cost);
extern unsigned int power_cost_at_freq(int cpu, unsigned int freq);
extern void reset_all_window_stats(u64 window_start, unsigned int window_size);
extern void boost_kick(int cpu);