[DMN] placement: packing policy
This commit is contained in:
parent
e16b05ce9e
commit
911bd62cc2
1 changed files with 20 additions and 1 deletions
21
placement.c
21
placement.c
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue