From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v3 10/14] libxc: get and set soft and hard affinity Date: Tue, 19 Nov 2013 14:58:53 +0000 Message-ID: <528B7CAD.5020604@eu.citrix.com> References: <20131118175544.31002.79574.stgit@Solace> <20131118181805.31002.28692.stgit@Solace> <528B7AE8.1030704@eu.citrix.com> <1384873020.30014.126.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384873020.30014.126.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Marcus Granado , Keir Fraser , Matt Wilson , Li Yechen , Andrew Cooper , Dario Faggioli , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich , Justin Weaver , Elena Ufimtseva , Juergen Gross List-Id: xen-devel@lists.xenproject.org On 11/19/2013 02:57 PM, Ian Campbell wrote: > On Tue, 2013-11-19 at 14:51 +0000, George Dunlap wrote: >> On 11/18/2013 06:18 PM, Dario Faggioli wrote: >>> by using the new flag introduced in the parameters of the >>> DOMCTL_{get,set}_vcpuaffinity hypercall. >>> >>> This happens by adding a new parameter (flags) to >>> xc_vcpu_setaffinity() and xc_vcpu_getaffinity(), so that the >>> caller can decide to set either the soft or hard affinity, or >>> even both. >>> >>> In case of setting both hard and soft, they are set to the >>> same cpumap. xc_get_setaffinity() also takes another new param, >>> for reporting back to the caller what the actual affinity the >>> scheduler uses will be after a successful call. >>> In case of asking to get both hard and soft, what the caller >>> gets is the intersection between them. >>> >>> In-tree callers are also fixed to cope with the new interface. >>> >>> Signed-off-by: Dario Faggioli >> >> Acked-by: George Dunlap >> >> But... >> >>> --- >>> Changes from v2: >>> * better cleanup logic in _vcpu_setaffinity() (regarding >>> xc_hypercall_buffer_{alloc,free}()), as suggested during >>> review; >>> * make it more evident that DOMCTL_setvcpuaffinity has an out >>> parameter, by calling ecpumap_out, and improving the comment >>> wrt that; >>> * change the interface and have xc_vcpu_[sg]etaffinity() so >>> that they take the new parameters (flags and ecpumap_out) and >>> fix the in tree callers. >>> --- >>> tools/libxc/xc_domain.c | 47 +++++++++++++++++++++-------------- >>> tools/libxc/xenctrl.h | 44 ++++++++++++++++++++++++++++++++- >>> tools/libxl/libxl.c | 7 ++++- >>> tools/ocaml/libs/xc/xenctrl_stubs.c | 8 ++++-- >>> tools/python/xen/lowlevel/xc/xc.c | 6 +++- >>> 5 files changed, 86 insertions(+), 26 deletions(-) >>> >>> diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c >>> index f9ae4bf..bddf4e0 100644 >>> --- a/tools/libxc/xc_domain.c >>> +++ b/tools/libxc/xc_domain.c >>> @@ -192,44 +192,52 @@ int xc_domain_node_getaffinity(xc_interface *xch, >>> int xc_vcpu_setaffinity(xc_interface *xch, >>> uint32_t domid, >>> int vcpu, >>> - xc_cpumap_t cpumap) >>> + xc_cpumap_t cpumap, >>> + uint32_t flags, >>> + xc_cpumap_t ecpumap_out) >>> { >>> DECLARE_DOMCTL; >>> - DECLARE_HYPERCALL_BUFFER(uint8_t, local); >>> + DECLARE_HYPERCALL_BUFFER(uint8_t, cpumap_local); >>> + DECLARE_HYPERCALL_BUFFER(uint8_t, ecpumap_local); >>> int ret = -1; >>> int cpusize; >>> >>> cpusize = xc_get_cpumap_size(xch); >>> - if (!cpusize) >>> + if ( !cpusize ) >> >> I know IanJ will have something to say about non-snuggly braces here and >> below. :-) > > The spaces are legit in libxc I think, it uses Xen coding style. It's > libxl which differs... OK -- I just happened to see snuggly braces elsewhere in the file when I took a quick glance around. It has my Ack either way. -George