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] xl: fix broken xl vcpu-list output

To: Andre Przywara <andre.przywara@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: fix broken xl vcpu-list output
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Fri, 4 Feb 2011 15:16:28 +0000
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Fri, 04 Feb 2011 07:15:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D4C06AA.10002@xxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4D4C06AA.10002@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Fri, 4 Feb 2011, Andre Przywara wrote:
> Hi,
> 
> # xl vcpu-list
> hangs on my big box. The issue is an endless loop, where the algorithm
> for printing the CPU affinity in a condensed way looks for a set bit in
> a zero-byte:
>               for (i = 0; !(pcpumap & 1); ++i, pcpumap >>= 1)
> Looking at the code I found that it is entirely broken if more than 8
> CPUs are used. Beside that endless loop issue the output is totally
> bogus except for the "any CPU" case, which is handled explicitly earlier.
> I tried to fix it, but the whole approach does not work if the outer
> loops actually iterates (executing more than once).
> I could not copy the Linux version of that algorithm due to licensing
> incompatibilities and the Python version is not easily converted to C,
> so I coded my own version from scratch. It is a bit verbose since it
> iterates over bits instead of bytes, but more cleaner and survived some
> unit-testing. I didn't spend much time in optimizing it, though.
> I put it in a separate function as I plan to use it later for printing
> cpupool affinity in a similar way (a post 4.1.0 patch living in one of 
> my branches).
> 
> If you have a better implementation available, I can push it through my 
> automated unit test easily.
> 
> Please review and apply to Xen 4.1.0-rc.
> 
> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>

Thank you very much for fixing this, also I like the implementation!

Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

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

<Prev in Thread] Current Thread [Next in Thread>