sched/fair: Don't let tasks slip away from gold to silver cluster

We often see a BIG/medium task being migrated from gold cluster to
silver cluster during load balance when the gold CPU has 2 tasks
including this BIG task. For example, BIG task wakes up a binder
and binder preempts and running. At this time, the silver CPU pull
the BIG task since the overall utilization is more. The gold CPU
becomes idle immediately and may not be able to pull the medium
task. It can also happen when a pinned kworker runs on the gold
CPU.

Change-Id: I7d8caad6978bfa93aa3cdd772400e807b9f15e3d
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
tirimbino
Pavankumar Kondeti 6 years ago
parent 0f0132aa92
commit d89e049987
  1. 4
      kernel/sched/fair.c

@ -203,6 +203,7 @@ unsigned int sysctl_sched_min_task_util_for_boost = 51;
/* 0.68ms default for 20ms window size scaled to 1024 */
unsigned int sysctl_sched_min_task_util_for_colocation = 35;
#endif
static unsigned int __maybe_unused sched_small_task_threshold = 102;
static inline void update_load_add(struct load_weight *lw, unsigned long inc)
{
@ -10709,7 +10710,8 @@ static struct rq *find_busiest_queue(struct lb_env *env,
*/
if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
capacity_of(env->dst_cpu) < capacity &&
rq->nr_running == 1)
(rq->nr_running == 1 || (rq->nr_running == 2 &&
task_util(rq->curr) < sched_small_task_threshold)))
continue;
wl = weighted_cpuload(rq);

Loading…
Cancel
Save