From: Ryan Harper <ryanh@us.ibm.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] tools: convert cpumap bitmap to list
Date: Thu, 20 Oct 2005 10:24:55 -0500 [thread overview]
Message-ID: <20051020152455.GD2004@us.ibm.com> (raw)
In-Reply-To: <c0d8356416e3a05f9aee067327d3494c@cl.cam.ac.uk>
* Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2005-10-20 05:39]:
>
> On 19 Oct 2005, at 23:45, Ryan Harper wrote:
>
> >This patch modifies the lowlevel xc vcpuinfo call to convert a vcpu's
> >cpumap to a list of int. XendDomainInfo.py filters the cpumap into a
> >smaller list that is bound by the number of vcpus allocated to a
> >domain.
>
> Two things:
>
> First, there is no correspondence between size of cpumap and
> max_vcpu_id, because there is no direct relationship between sizes of
> virtual and physical CPU spaces. We could have a system with more vcpus
> than physical cpus, or vice versa. And cpumap represents sets of
> physical cpus, not sets of virtual cpus.
Right. I was carrying through the previous incorrect behavior:
cpumap = sxp.child_value(info, 'cpumap', [])
mask = ((int(sxp.child_value(info, 'vcpus', '0')))**2) - 1
>
> Second, I meant that the cpumap list should contain just the list of
> physical cpus that that vcpu can run on. So, for example, a cpumap
> bitmask of 0x5 would correspond to the cpumap list [0, 2], not the list
> [0, -1, 2, -1, -1, ...]. The latter is a weird and redundant
> representation.
OK. That was my poor hack around python/c blowing up if you didn't fill
out every spot in the list you created. I'm going to switch to using
PyList_Append() rather than creating the list size up front.
Are you interested in any modification of the cpumap to list conversion?
Or is it ok if vcpu-list shows a long list of integers?
I would think mapping cpu % nr_cpus, throwing away duplicates would be
best. With [0,1,2,3] and nr_cpus=2, cpumap would be [0,1].
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253 T/L: 678-9253
ryanh@us.ibm.com
next prev parent reply other threads:[~2005-10-20 15:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-19 22:45 [PATCH] tools: convert cpumap bitmap to list Ryan Harper
2005-10-20 10:44 ` Keir Fraser
2005-10-20 15:24 ` Ryan Harper [this message]
2005-10-20 16:03 ` Keir Fraser
2005-10-20 16:23 ` Ryan Harper
2005-10-20 20:10 ` Keir Fraser
2005-10-21 14:03 ` Ryan Harper
2005-10-21 15:04 ` Keir Fraser
2005-10-21 15:02 ` Ryan Harper
2005-10-21 16:59 ` [PATCH] build cpumap from list of ints Ryan Harper
2005-10-21 17:52 ` Ryan Harper
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=20051020152455.GD2004@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--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.