[xen staging] xen/sched: Re-position the domain_update_node_affinity() call during vcpu construction
Author: Andrew Cooper <[hidden email]>
AuthorDate: Thu Sep 6 14:40:56 2018 +0100
Commit: Andrew Cooper <[hidden email]>
CommitDate: Tue Sep 11 17:34:35 2018 +0100
xen/sched: Re-position the domain_update_node_affinity() call during vcpu construction
alloc_vcpu()'s call to domain_update_node_affinity() has existed for a decade,
but its effort is mostly wasted.
alloc_vcpu() is called in a loop for each vcpu, bringing them into existence.
The values of the affinity masks are still default, which is allcpus in
general, or a processor singleton for pinned domains.
Furthermore, domain_update_node_affinity() itself loops over all vcpus
accumulating the masks, making it quadratic with the number of vcpus.
Move it to be called once after all vcpus are constructed, which has the same
net effect, but with fewer intermediate memory allocations and less cpumask
/* Set up CR3 value for write_ptbase */
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 9a541971dd..a043812687 100644
@@ -193,9 +193,6 @@ struct vcpu *alloc_vcpu(
/* Must be called after making new vcpu visible to for_each_vcpu(). */