WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] tools: convert cpumap bitmap to list

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] tools: convert cpumap bitmap to list
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Thu, 20 Oct 2005 10:24:55 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 20 Oct 2005 15:22:15 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <c0d8356416e3a05f9aee067327d3494c@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20051019224507.GC2004@xxxxxxxxxx> <c0d8356416e3a05f9aee067327d3494c@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
* Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> [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@xxxxxxxxxx

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel