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

Re: [Xen-devel] [PATCH 5/5] libxl: Make 'xl vcpu-set' work properly on overcommited hosts with an override.

On Fri, 2013-05-10 at 22:00 +0100, Konrad Rzeszutek Wilk wrote:
> The libxl_cpu_bitmap_alloc(..) function, if provided with a zero
> value for max CPUs will call xc_get_max_cpus() which will retrieve
> the number of physical CPUs the host has. This is usually
> OK if the guest's maxvcpus <= host pcpus. But if the value
> is different, then the bitmap for VCPUs is limited by the
> number of CPUs the host has.
> This is incorrect as what we want is to hotplug in the guest
> the amount of CPUs that the user specified on the command line
> and not be limited by the amount of physical CPUs.
> This means that a guest config like this:
> vcpus=8
> maxvcpus=32
> and on a 4 PCPU machine doing
> xl vcpu-set <guest name> 16
> won't work. This is b/c the the size of the bitmap is one byte
> so it can only hold up to 8 VCPUs. Hence anything above that
> is going to be ignored.
> Note that this patch also fixes the bitmap setting - as it
> would set all of the bits allowed. Meaning if the user had a 4PCPU
> host we would still allow the user to set 8VCPUs. This second
> iteration of the patch fixes this.
> Note that all of the libxl_cpu_bitmap_[test|set] silently ignore
> any test or sets above its size:
>      if (bit >= bitmap->size * 8)
>          return 0;
> so we were never notified off this bug.
> This patch warns the user if they are trying to do this. If the
> user really wants to do this they have to provide the --ignore-host
> parameter to bypass this check.
> [v1: Add --ignore-host and also fix the bitmap being updated to
> the full word instead of to the count of physical CPUs]
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

This looks good to me, thanks:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Xen-devel mailing list



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