#endif
#ifdef CONFIG_SCHED_HMP
+static unsigned int hmp_task_eligible_for_up_migration(struct sched_entity *se)
+{
+ /* below hmp_up_threshold, never eligible */
+ if (se->avg.load_avg_ratio < hmp_up_threshold)
+ return 0;
+ return 1;
+}
+
/* Check if task should migrate to a faster cpu */
static unsigned int hmp_up_migration(int cpu, int *target_cpu, struct sched_entity *se)
{
if (p->prio >= hmp_up_prio)
return 0;
#endif
- if (se->avg.load_avg_ratio < hmp_up_threshold)
+ if (!hmp_task_eligible_for_up_migration(se))
return 0;
/* Let the task load settle before doing another up migration */
}
orig = curr;
curr = hmp_get_heaviest_task(curr, 1);
- if (curr->avg.load_avg_ratio > hmp_up_threshold &&
+ /* check if heaviest eligible task on this
+ * CPU is heavier than previous task
+ */
+ if (hmp_task_eligible_for_up_migration(curr) &&
curr->avg.load_avg_ratio > ratio) {
p = task_of(curr);
target = rq;