From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Re: [Patch] update cpumask handling for cpu pools in libxc and python
Date: Fri, 17 Sep 2010 12:04:11 +0200 [thread overview]
Message-ID: <4C933D1B.3040308@ts.fujitsu.com> (raw)
In-Reply-To: <1284716674.16095.3180.camel@zakaz.uk.xensource.com>
On 09/17/10 11:44, Ian Campbell wrote:
> On Fri, 2010-09-17 at 10:20 +0100, Juergen Gross wrote:
>> On 09/17/10 11:00, Ian Campbell wrote:
>>> local_size has already been rounded up in get_cpumap_size. Do we really
>>> need to do it again?
>>
>> I've made it more clear that this is rounding to uint64.
>
> Wouldn't that be "(.. + 63) / 8" then?
No, local_size is already bytes...
>>
>>>
>>>> + size = sizeof(xc_cpupoolinfo_t) + cpumap_size * 8 + local_size;
>>>
>>> Why do we need both "cpumap_size * 8" and local_size additional bytes
>>> here? Both contain the number of bytes necessary to contain a cpumap
>>> bitmask and in fact I suspect they are both equal at this point (see
>>> point about rounding above).
>>
>> The hypervisor returns a cpumask based on bytes, the tools use uint64-based
>> cpumasks.
>
> Oh, I see, as well as xc_cpupool_info_t and the cpumap which it contains
> being allocated together in a single buffer you are also including a
> third buffer which is for local use in this function only but which is
> included in the memory region returned to the caller (who doesn't know
> about it). Seems a bit odd to me, why not just allocate it locally then
> free it (or use alloca)?
>
> Actually, when I complete my hypercall buffer patch this memory will
> need to be separately allocated any way since it needs to come from a
> special pool. I'd prefer it if you just used explicit separate
> allocation for this buffer from the start.
Okay.
>
>> In practice this is equivalent as long as multiple of 8 bytes are
>> written by the hypervisor and the system is running little endian.
>> I prefer a clean interface mapping here.
>
> Using a single uint64 when there was a limit of 64 cpus made sense but
> now that it is variable length why not just use bytes everywhere? It
> would avoid a lot of confusion about what various size units are at
> various points etc. You would avoid needing to translate between the
> hypervisor and tools representations too, wouldn't you?
This would suggest changing xc_vcpu_setaffinity() and
--
Juergen Gross Principal Developer Operating Systems
TSP ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28 Internet: ts.fujitsu.com
D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html
next prev parent reply other threads:[~2010-09-17 10:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-17 5:51 [Patch] update cpumask handling for cpu pools in libxc and python Juergen Gross
2010-09-17 9:00 ` Ian Campbell
2010-09-17 9:20 ` Juergen Gross
2010-09-17 9:44 ` Ian Campbell
2010-09-17 10:04 ` Juergen Gross [this message]
2010-09-17 10:10 ` Ian Campbell
[not found] ` <4C934619.1000807@ts.fujitsu.com>
[not found] ` <1284720423.16095.3257.camel@zakaz.uk.xensource.com>
[not found] ` <4C9348BA.4000705@ts.fujitsu.com>
[not found] ` <1284723441.16095.3355.camel@zakaz.uk.xensource.com>
[not found] ` <19603.39418.809534.435478@mariner.uk.xensource.com>
[not found] ` <4C96EC80.4000901@ts.fujitsu.com>
2010-09-17 10:08 ` Juergen Gross
2010-09-17 13:40 ` Ian Campbell
2010-09-17 15:51 ` Ian Jackson
[not found] ` <4C983A51.5000105@ts.fujitsu.com>
2010-09-21 15:04 ` Re: [Patch] update cpumask handling for cpu pools in libxc and python [and 1 more messages] Ian Jackson
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=4C933D1B.3040308@ts.fujitsu.com \
--to=juergen.gross@ts.fujitsu.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.