Change the tryAlloc/tryReloc workflow
authorIustin Pop <iustin@google.com>
Thu, 9 Jul 2009 12:44:24 +0000 (14:44 +0200)
committerIustin Pop <iustin@google.com>
Thu, 9 Jul 2009 12:44:24 +0000 (14:44 +0200)
commit478df6860fe53fa36264bd8a7ca6cfdda4afd124
treea1e16163627cccbf29287a702a43c540ead568be
parent685935f795f8782af9c7556d464fb122f51c9773
Change the tryAlloc/tryReloc workflow

Currently, the tryAlloc and tryReloc function return a list with all the
results, both failures and successes. This is fine for hail, which does
one round of allocations, but is not so good for hspace, which does
iterative rounds; since at each (successful) step we only take the best
solution, it means that we're using lots of heap space to compute and
store node lists which are thrown away at the end of the step.

This patch changes these two functions and their callers in hail/hspace
to only return the best solution, and error/success counters. This
allows hspace to run in a much smaller space, and reduces GC cost
greatly.

Overall, it is a cleanup, as hail/hspace did a lot of work to chose this
best solution, whereas now it's automatically promoted within
Cluster.concatAllocs.
Ganeti/HTools/Cluster.hs
Ganeti/HTools/Types.hs
hail.hs
hspace.hs