[DNM] irqlist: initial implementation for migration condition for

packing
This commit is contained in:
Peter Cai 2022-09-16 20:59:13 -04:00
parent 7218ded6d7
commit cbdb399e6d
2 changed files with 24 additions and 2 deletions

View file

@ -79,7 +79,7 @@ static void move_candidate_irqs(struct irq_info *info, void *data)
unsigned long delta_load = 0;
/* Don't rebalance irqs that don't want it */
if (info->level == BALANCE_NONE)
if (info->level == BALANCE_NONE || info->level == BALANCE_CORE)
return;
/* Don't move cpus that only have one irq, regardless of load */
@ -113,6 +113,27 @@ static void move_candidate_irqs(struct irq_info *info, void *data)
info->assigned_obj = NULL;
}
static void move_candidate_irqs_packing(GList *irqs, struct topo_obj *obj, struct load_balance_info *lb_info)
{
GList *entry;
entry = g_list_last(irqs);
while (entry) {
struct irq_info *info = entry->data;
// Only pack BALANCE_CORE irqs
if (info->level != BALANCE_CORE)
continue;
if (lb_info->adjustment_load >= obj->max_load / 10 * 9) {
lb_info->adjustment_load -= info->load;
migrate_irq(&info->assigned_obj->interrupts, &rebalance_irq_list, info);
}
entry = g_list_previous(entry);
}
}
static void migrate_overloaded_irqs(struct topo_obj *obj, void *data)
{
struct load_balance_info *info = data;
@ -143,6 +164,7 @@ static void migrate_overloaded_irqs(struct topo_obj *obj, void *data)
*/
info->adjustment_load = obj->load;
for_each_irq(obj->interrupts, move_candidate_irqs, info);
move_candidate_irqs_packing(obj->interrupts, obj, info);
}
}

View file

@ -91,7 +91,7 @@ static void find_best_object_packing(GList *objs, struct irq_info *info, struct
(!cpus_intersects(d->mask, unbanned_cpus)))
continue;
if (d->load + info->load < d->max_load) {
if (d->load + info->load < d->max_load / 10 * 9) {
place->best = d;
place->best_cost = d->load + info->load;
return;