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

Re: [Xen-devel] [PATCH v9 8/9] libxl/xl: enable for specifying soft-affinity in the config file



On Wed, 2014-06-18 at 16:28 +0200, Dario Faggioli wrote:

$subject starts "enable for specifying". I think a word must be missing.

> in a similar way to how hard-affinity is specified (i.e.,
> exactly how plain vcpu-affinity was being specified before
> this change).
> 
> To do so, we add a vcpu_soft_affinity array to build_info,
> and treat it much like vcpu_hard_affinity. The new config
> option is called "cpus_soft".

Not any more.

>  /*
> + * LIBXL_HAVE_BUILDINFO_VCPU_SOFT_AFFINITY_ARRAY

You could probably combine this #define with the HARD ones, after all
they arrived at the same time.

i.e. in the hard affinity patch:
/* to be uncommented when soft array added */
/* #define LIBXL_HAVE_BUILDINFO_VCPU_AFFINITY_ARRAYS */
and then uncomment it here.

At the very least they could share a doc comment.

> + * If this is defined, then libxl_domain_build_info structure will
> + * contain vcpu_soft_affinity, an array of libxl_bitmap that contains
> + * the necessary information to set the soft affinity of each VCPU to
> + * a set of PCPUs.
> + *
> + * The number of libxl_bitmap in the array equals to the maximum number
> + * of VCPUs. The size of each bitmap is computed basing on the maximum
> + * number of PCPUs.

Like with the previous version this should be worded in terms of what is
expected of the caller.

> + */
> +#define LIBXL_HAVE_BUILDINFO_VCPU_SOFT_AFFINITY_ARRAY 1
> +
> +/*
>   * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
>   *
>   * If this is defined, then the libxl_domain_build_info structure will
> @@ -720,13 +730,12 @@ static void parse_vcpu_affinity(XLU_Config *config, 
> XLU_ConfigList *cpus,
>       * vcpus than elements, the missing ones have their affinity masks
>       * completely full).
>       */
> -    for (i = 0; i < info->num_vcpu_hard_affinity; i++) {
> +    for (i = 0; i < info->max_vcpus; i++) {

Would have been better to just start this way.



_______________________________________________
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®.