Skip to content
Commit 2ba4118d authored by Valentin Schneider's avatar Valentin Schneider Committed by Ionela Voinescu
Browse files

sched/fair: Filter out locally-unsolvable misfit imbalances



Consider the following asymmetric CPU capacity topology, with some amount
of capacity pressure (RT | DL | IRQ | thermal):

  DIE [          ]
  MC  [    ][    ]
       0  1  2  3

  | CPU | capacity_orig | capacity |
  |-----+---------------+----------|
  |   0 |           870 |      860 |
  |   1 |           870 |      600 |
  |   2 |          1024 |      850 |
  |   3 |          1024 |      860 |

If CPU1 has a misfit task, then CPU0, CPU2 and CPU3 are valid candidates to
grant the task an uplift in CPU capacity. Consider CPU0 and CPU3 as
sufficiently busy, i.e. don't have enough spare capacity to accommodate
CPU1's misfit task. This would then fall on CPU2 to pull the task.

This currently won't happen, because CPU2 will fail

  capacity_greater(capacity_of(CPU2), sg->sgc->max_capacity)

where 'sg' is the [0, 1] group at DIE level. In this case, the max_capacity
is that of CPU0's, which is at this point in time greater than that of
CPU2's. This comparison doesn't make much sense, given that the only CPUs
we should care about in this scenario are CPU1 (the CPU with the misfit
task) and CPU2 (the load-balance destination CPU).

Aggregate a misfit task's load into sgs->group_misfit_task_load only if
env->dst_cpu would grant it a capacity uplift. Separately track whether a
sched_group contains a misfit task to still classify it as
group_misfit_task and not pick it as busiest group when pulling from a
lower-capacity CPU.

Since find_busiest_queue() can now iterate over CPUs with a higher capacity
than the local CPU's, add a capacity check there.

Signed-off-by: default avatarValentin Schneider <valentin.schneider@arm.com>
parent 975c863b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment