[libvirt] [PATCHv3 4/8] qemu: bulk stats: implement VCPU group

Peter Krempa pkrempa at redhat.com
Thu Sep 11 16:07:48 UTC 2014


On 09/11/14 17:54, Francesco Romani wrote:
> ----- Original Message -----
>> From: "Peter Krempa" <pkrempa at redhat.com>
>> To: "Francesco Romani" <fromani at redhat.com>, libvir-list at redhat.com
>> Sent: Tuesday, September 9, 2014 1:56:09 PM
>> Subject: Re: [libvirt] [PATCHv3 4/8] qemu: bulk stats: implement VCPU group
> 
>>> + * VIR_DOMAIN_STATS_VCPU: Return virtual CPU statistics.
>>> + * Due to VCPU hotplug, the vcpu.<num>.* array could be sparse.
>>> + * The actual size of the array correspond to "vcpu.current".
>>> + * The array size will never exceed "vcpu.maximum".
>>> + * The typed parameter keys are in this format:
>>> + * "vcpu.current" - current number of online virtual CPUs as unsigned int.
>>> + * "vcpu.maximum" - maximum number of online virtual CPUs as unsigned int.
>>> + * "vcpu.<num>.state" - state of the virtual CPU <num>, as int
>>> + *                      from virVcpuState enum.
>>> + * "vcpu.<num>.time" - virtual cpu time spent by virtual CPU <num>
>>> + *                     as unsigned long long.
>>> + * "vcpu.<num>.cpu" - physical CPU pinned to virtual CPU <num> as int.
>>
>> This is not the CPU number the vCPU is pinned to but rather the current
>> CPU number where the vCPU is actually running. If you pin it to multiple
>> CPUs this may change in the range of the host CPUs the vCPU is pinned
>> to. Said this I don't think this is an useful stat.
> 
> Right, my bad, I overlooked the docs (started to suspect when saw it changing too often
> in my tests..).
> 
> I agree this is not very useful, I'll drop it.
> 
>> Rather than this I'd like to see the mask of the host CPUs where this
>> vCPU is pinned to. (returned as a human readable bitmask string).
>>
>> Any thoughts?
> 
> Is that the data provided by http://libvirt.org/html/libvirt-libvirt.html#virDomainGetVcpuPinInfo
> it isn't? (I'm asking because docs aren't crystal clear for me).

Yes that's exactly it. You should return it as a bitmap formatted to a
string. (see virBitmapFormat).

> 
> I like this, but I'd also need to do a cross-check on my our code in oVirt.
> 
> Will be acceptable to drop the misleading vcpu.<num>.cpu info and to add
> the pin info in a new followup patch, in this stats group?

You definitely can add that later on. But you should drop .cpu from this
patch (not revert it later).

> 
> Bests,
> 

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140911/d5cc42d2/attachment-0001.sig>


More information about the libvir-list mailing list