From: Wei Liu Date: Mon, 16 Mar 2015 09:52:33 +0000 (+0000) Subject: libxl: disallow memory relocation when vNUMA is enabled X-Git-Tag: 4.6.0-rc1~951 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a2b82221dc2c3f996250f9e465a3ce39cd4233c9;p=xen.git libxl: disallow memory relocation when vNUMA is enabled Disallow memory relocation when vNUMA is enabled, because relocated memory ends up off node. Further more, even if we dynamically expand node coverage in hvmloader, low memory and high memory may reside in different physical nodes, blindly relocating low memory to high memory gives us a sub-optimal configuration. Introduce a function called libxl__vnuma_configured and use it. Signed-off-by: Wei Liu Cc: Ian Campbell Cc: Ian Jackson Cc: Konrad Wilk Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index a8b08f2d9e..fc88d68227 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1378,13 +1378,15 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss) libxl__sprintf(gc, "%s/hvmloader/bios", path), "%s", libxl_bios_type_to_string(b_info->u.hvm.bios)); /* Disable relocating memory to make the MMIO hole larger - * unless we're running qemu-traditional */ + * unless we're running qemu-traditional and vNUMA is not + * configured. */ libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/allow-memory-relocate", path), "%d", - b_info->device_model_version==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL); + b_info->device_model_version==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL && + !libxl__vnuma_configured(b_info)); free(path); } diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 202cea175c..d2b19a0f27 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -3434,6 +3434,7 @@ int libxl__vnuma_build_vmemrange_hvm(libxl__gc *gc, libxl_domain_build_info *b_info, libxl__domain_build_state *state, struct xc_hvm_build_args *args); +bool libxl__vnuma_configured(const libxl_domain_build_info *b_info); _hidden int libxl__ms_vm_genid_set(libxl__gc *gc, uint32_t domid, const libxl_ms_vm_genid *id); diff --git a/tools/libxl/libxl_vnuma.c b/tools/libxl/libxl_vnuma.c index 72339f74ac..aad297edad 100644 --- a/tools/libxl/libxl_vnuma.c +++ b/tools/libxl/libxl_vnuma.c @@ -17,6 +17,11 @@ #include "libxl_arch.h" #include +bool libxl__vnuma_configured(const libxl_domain_build_info *b_info) +{ + return b_info->num_vnuma_nodes != 0; +} + /* Sort vmemranges in ascending order with "start" */ static int compare_vmemrange(const void *a, const void *b) {