static inline int find_best_target(struct task_struct *p, int *backup_cpu,
bool boosted, bool prefer_idle)
{
- unsigned long best_idle_min_cap_orig = ULONG_MAX;
unsigned long min_util = boosted_task_util(p);
unsigned long target_capacity = ULONG_MAX;
unsigned long min_wake_util = ULONG_MAX;
(capacity_orig * SCHED_CAPACITY_SCALE))
continue;
+ /*
+ * Favor CPUs with smaller capacity for non latency
+ * sensitive tasks.
+ */
+ if (capacity_orig > target_capacity)
+ continue;
+
/*
* Case B) Non latency sensitive tasks on IDLE CPUs.
*
if (idle_cpu(i)) {
int idle_idx = idle_get_state_idx(cpu_rq(i));
- /* Select idle CPU with lower cap_orig */
- if (capacity_orig > best_idle_min_cap_orig)
- continue;
-
/*
* Skip CPUs in deeper idle state, but only
* if they are also less energy efficient.
best_idle_cstate <= idle_idx)
continue;
- /* Keep track of best idle CPU */
- best_idle_min_cap_orig = capacity_orig;
+ target_capacity = capacity_orig;
best_idle_cstate = idle_idx;
best_idle_cpu = i;
continue;
* capacity.
*/
- /* Favor CPUs with smaller capacity */
- if (capacity_orig > target_capacity)
- continue;
-
/* Favor CPUs with maximum spare capacity */
if ((capacity_orig - new_util) < target_max_spare_cap)
continue;