[DMN] placement: packing policy

This commit is contained in:
Peter Cai 2022-09-13 12:39:49 -04:00
parent e16b05ce9e
commit 911bd62cc2

View file

@ -70,6 +70,21 @@ static void find_best_object(struct topo_obj *d, void *data)
}
}
static void find_best_object_packing(GList *objs, struct irq_info *info, struct obj_placement *place)
{
GList *entry;
entry = g_list_first(objs);
while (entry) {
struct topo_obj *d = entry->data;
if (d->load + info->load < 0.9e9) {
place->best = d;
place->best_cost = d->load + info->load;
return;
}
entry = g_list_next(entry);
}
}
static void find_best_object_for_irq(struct irq_info *info, void *data)
{
struct obj_placement place;
@ -105,7 +120,11 @@ static void find_best_object_for_irq(struct irq_info *info, void *data)
place.best = NULL;
place.best_cost = ULLONG_MAX;
for_each_object(d->children, find_best_object, &place);
if (info->level != BALANCE_CORE) {
for_each_object(d->children, find_best_object, &place);
} else {
find_best_object_packing(d->children, info, &place);
}
asign = place.best;