From: Ian Campbell <Ian.Campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>, xen-devel@lists.xen.org
Subject: Re: [PATCH for-4.5] libxl: allow copying between bitmaps of different sizes
Date: Tue, 25 Nov 2014 15:21:50 +0000 [thread overview]
Message-ID: <1416928910.16769.0.camel@citrix.com> (raw)
In-Reply-To: <1416928416-21329-1-git-send-email-wei.liu2@citrix.com>
On Tue, 2014-11-25 at 15:13 +0000, Wei Liu wrote:
> When parsing bitmap objects JSON parser will create libxl_bitmap map of the
> smallest size needed.
>
> This can cause problems when saved image file specifies CPU affinity. For
> example, if 'vcpu_hard_affinity' in the saved image has only the first CPU
> specified, just a single byte will be allocated and libxl_bitmap->size will be
> set to 1.
>
> This will result in assertion in libxl_set_vcpuaffinity()->libxl_bitmap_copy()
> since the destination bitmap is created for maximum number of CPUs.
>
> We could allocate that bitmap of the same size as the source, however, it is
> later passed to xc_vcpu_setaffinity() which expects it to be sized to the max
> number of CPUs
>
> To fix this issue, introduce an internal function to allowing copying between
> bitmaps of different sizes. Note that this function is only used in
> libxl_set_vcpuaffinity at the moment. Though NUMA placement logic invokes
> libxl_bitmap_copy as well there's no need to replace those invocations. NUMA
> placement logic comes into effect when no vcpu / node pinning is provided, so
> it always operates on bitmap of the same sizes (that is, size of maximum
> number of cpus /nodes).
>
> Reported-and-tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
prev parent reply other threads:[~2014-11-25 15:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 15:13 [PATCH for-4.5] libxl: allow copying between bitmaps of different sizes Wei Liu
2014-11-25 15:21 ` Ian Campbell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416928910.16769.0.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.