|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH] xl: fix broken xl vcpu-list output
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
|
|
|
|
|