aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/memory.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-08-04 15:35:28 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-08-04 15:35:28 +0100
commit91c6005e01321a07b0ea8ecc5a3066ba70389e47 (patch)
tree5f6d52a7e734aab495c0b7d01eeb832317701b8b /xen/common/memory.c
parent6044f6fa8d0c4f1ddf42eb18d91f4e4044d83cae (diff)
downloadxen-91c6005e01321a07b0ea8ecc5a3066ba70389e47.tar.gz
xen-91c6005e01321a07b0ea8ecc5a3066ba70389e47.tar.bz2
xen-91c6005e01321a07b0ea8ecc5a3066ba70389e47.zip
numa: Attempt more efficient NUMA allocation in hypervisor by default.
1. Try to allocate from nodes containing CPUs which a guest can be scheduled on. 2. Remember which node we allocated from last, and round-robin allocations among above-mentioned nodes. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r--xen/common/memory.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 924f07a1e1..9dd0307f96 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -259,7 +259,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
unsigned long in_chunk_order, out_chunk_order;
xen_pfn_t gpfn, gmfn, mfn;
unsigned long i, j, k;
- unsigned int node, memflags = 0;
+ unsigned int memflags = 0;
long rc = 0;
struct domain *d;
struct page_info *page;
@@ -324,10 +324,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
d,
XENMEMF_get_address_bits(exch.out.mem_flags) ? :
(BITS_PER_LONG+PAGE_SHIFT)));
- node = XENMEMF_get_node(exch.out.mem_flags);
- if ( node == NUMA_NO_NODE )
- node = domain_to_node(d);
- memflags |= MEMF_node(node);
+ memflags |= MEMF_node(XENMEMF_get_node(exch.out.mem_flags));
for ( i = (exch.nr_exchanged >> in_chunk_order);
i < (exch.in.nr_extents >> in_chunk_order);
@@ -545,7 +542,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE(void) arg)
}
args.memflags |= MEMF_node(XENMEMF_get_node(reservation.mem_flags));
- if (reservation.mem_flags & XENMEMF_exact_node_request)
+ if ( reservation.mem_flags & XENMEMF_exact_node_request )
args.memflags |= MEMF_exact_node;
if ( op == XENMEM_populate_physmap