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

Commit b3d3f38e authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/fair: Use CPU original capacity for max capacity CPU check



task_fits_max() checks if a task fits on a given CPU or not. Any task
can fit on the max capacity CPU. so task_fits_max() should return
true when called on a max capacity CPU. However the check inside
this funciton uses CPU capacity instead of original capacity when
comparing against max capacity. The CPU capacity can be lower than
the original capacity for a max capacity CPU due to RT tasks. In
such cases, we fail to upmigrate to the max capacity CPU.

Change-Id: I9f3c14b91d9a6d8a61bbd3a1fe7a8f4aa7415987
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 98cd82ec
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -6945,7 +6945,7 @@ static inline int task_fits_capacity(struct task_struct *p,

static inline bool task_fits_max(struct task_struct *p, int cpu)
{
	unsigned long capacity = capacity_of(cpu);
	unsigned long capacity = capacity_orig_of(cpu);
	unsigned long max_capacity = cpu_rq(cpu)->rd->max_cpu_capacity;

	if (capacity == max_capacity)
@@ -7964,7 +7964,8 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
static inline void update_misfit_task(struct rq *rq, struct task_struct *p)
{
#ifdef CONFIG_SMP
	rq->misfit_task = !task_fits_capacity(p, capacity_of(rq->cpu), rq->cpu);
	rq->misfit_task = !task_fits_capacity(p, capacity_orig_of(rq->cpu),
					      rq->cpu);
#endif
}