[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 16/23] libxl: disallow memory relocation when vNUMA is enabled



On Thu, 2015-02-26 at 15:55 +0000, Wei Liu wrote:
> 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 <wei.liu2@xxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Konrad Wilk <konrad.wilk@xxxxxxxxxx>
> ---
> Changes in v6:
> 1. Introduce a helper function.
> ---
>  tools/libxl/libxl_dm.c       | 6 ++++--
>  tools/libxl/libxl_internal.h | 1 +
>  tools/libxl/libxl_vnuma.c    | 5 +++++
>  3 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index 8599a6a..7b09512 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -1365,13 +1365,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 e93089a..d04b6aa 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -3413,6 +3413,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 a0576ee..6af3cde 100644
> --- a/tools/libxl/libxl_vnuma.c
> +++ b/tools/libxl/libxl_vnuma.c
> @@ -17,6 +17,11 @@
>  #include "libxl_arch.h"
>  #include <stdlib.h>
>  
> +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)
>  {



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.