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

Commit acc14a6d authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

sched/boost: provide helper api for boost on big



Currently the two callsites check if a task has sched boost enabled
and if the boost policy is "boost on big". Provide a helper api
to do the needful checks. This will further help with improving
colocation boost in the upcoming patch.

Change-Id: Ia55e4fe6cae66d7c7883f8a3c0a5d851a7917fc8
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 4e48a9f1
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -6999,9 +6999,7 @@ static inline bool task_fits_max(struct task_struct *p, int cpu)
	if (capacity == max_capacity)
		return true;

	if (sched_boost_policy() == SCHED_BOOST_ON_BIG &&
					task_sched_boost(p) &&
					is_min_capacity_cpu(cpu))
	if (task_boost_on_big_eligible(p) && is_min_capacity_cpu(cpu))
		return false;

	return task_fits_capacity(p, capacity, cpu);
+13 −0
Original line number Diff line number Diff line
@@ -2899,6 +2899,14 @@ static inline bool task_placement_boost_enabled(struct task_struct *p)
	return false;
}

static inline bool task_boost_on_big_eligible(struct task_struct *p)
{
	bool boost_on_big = task_sched_boost(p) &&
				sched_boost_policy() == SCHED_BOOST_ON_BIG;

	return boost_on_big;
}

#else	/* CONFIG_SCHED_WALT */

struct walt_sched_stats;
@@ -2915,6 +2923,11 @@ static inline bool task_placement_boost_enabled(struct task_struct *p)
	return false;
}

static inline bool task_boost_on_big_eligible(struct task_struct *p)
{
	return false;
}

static inline void check_for_migration(struct rq *rq, struct task_struct *p) { }

static inline int sched_boost(void)
+1 −3
Original line number Diff line number Diff line
@@ -2529,7 +2529,6 @@ static void _set_preferred_cluster(struct related_thread_group *grp)
{
	struct task_struct *p;
	u64 combined_demand = 0;
	bool boost_on_big = sched_boost_policy() == SCHED_BOOST_ON_BIG;
	bool group_boost = false;
	u64 wallclock;

@@ -2548,7 +2547,7 @@ static void _set_preferred_cluster(struct related_thread_group *grp)
		return;

	list_for_each_entry(p, &grp->tasks, grp_list) {
		if (boost_on_big && task_sched_boost(p)) {
		if (task_boost_on_big_eligible(p)) {
			group_boost = true;
			break;
		}
@@ -2558,7 +2557,6 @@ static void _set_preferred_cluster(struct related_thread_group *grp)
			continue;

		combined_demand += p->ravg.coloc_demand;

	}

	grp->preferred_cluster = best_cluster(grp,