aboutsummaryrefslogtreecommitdiffstats
path: root/docs/misc
diff options
context:
space:
mode:
authorDario Faggioli <dario.faggioli@citrix.com>2013-04-17 10:57:35 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-04-17 12:11:15 +0100
commit05ad92287b9f91171d66fd0b3db84bca63025d9c (patch)
tree4306c2e02427f0eb7898fbb11f37a6bbba657e07 /docs/misc
parenta5d30c236a41e269313380bc584da9e7ddfa251d (diff)
downloadxen-05ad92287b9f91171d66fd0b3db84bca63025d9c.tar.gz
xen-05ad92287b9f91171d66fd0b3db84bca63025d9c.tar.bz2
xen-05ad92287b9f91171d66fd0b3db84bca63025d9c.zip
libxl: optimize the calculation of how many VCPUs can run on a candidate
For choosing the best NUMA placement candidate, we need to figure out how many VCPUs are runnable on each of them. That requires going through all the VCPUs of all the domains and check their affinities. With this change, instead of doing the above for each candidate, we do it once for all, populating an array while counting. This way, when we later are evaluating candidates, all we need is summing up the right elements of the array itself. This reduces the complexity of the overall algorithm, as it moves a potentially expensive operation (for_each_vcpu_of_each_domain {}) outside from the core placement loop, so that it is performed only once instead of (potentially) tens or hundreds of times. More specifically, we go from a worst case computation time complaxity of: O(2^n_nodes) * O(n_domains*n_domain_vcpus) To, with this change: O(n_domains*n_domains_vcpus) + O(2^n_nodes) = O(2^n_nodes) (with n_nodes<=16, otherwise the algorithm suggests partitioning with cpupools and does not even start.) Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'docs/misc')
0 files changed, 0 insertions, 0 deletions