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

Commit 1d82b5e3 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/rt: Add support for placement boost



When the placement boost is active for RT tasks, try to
find a CPU in higher capacity groups. If no such CPU is
available, fall back to the CPUs in the other groups.

Change-Id: I5a0edef592a72bee2f4bcca22a13ce7066972725
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 5ac6978f
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -1750,6 +1750,9 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)
	unsigned long tutil = task_util(task);
	int best_cpu_idle_idx = INT_MAX;
	int cpu_idle_idx = -1, start_cpu;
	bool boost_on_big = sched_boost() == FULL_THROTTLE_BOOST ?
				  (sched_boost_policy() == SCHED_BOOST_ON_BIG) :
				  false;

	rcu_read_lock();

@@ -1761,13 +1764,19 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)
	if (!sd)
		goto unlock;

retry:
	sg = sd->groups;
	do {
		int fcpu = group_first_cpu(sg);
		unsigned long capacity_orig = capacity_orig_of(fcpu);
		int capacity_orig = capacity_orig_of(fcpu);

		if (boost_on_big) {
			if (is_min_capacity_cpu(fcpu))
				continue;
		} else {
			if (capacity_orig > best_capacity)
				continue;
		}

		for_each_cpu_and(cpu, lowest_mask, sched_group_span(sg)) {
			if (cpu_isolated(cpu))
@@ -1821,6 +1830,11 @@ static int rt_energy_aware_wake_cpu(struct task_struct *task)

	} while (sg = sg->next, sg != sd->groups);

	if (unlikely(boost_on_big) && best_cpu == -1) {
		boost_on_big = false;
		goto retry;
	}

unlock:
	rcu_read_unlock();
	return best_cpu;