public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	kvm@vger.kernel.org, pbonzini@redhat.com, berrange@redhat.com,
	"Peter Krempa" <pkrempa@redhat.com>,
	"John Ferlan" <jferlan@redhat.com>,
	libvir-list@redhat.com,
	"Christian Borntraeger" <borntraeger@de.ibm.com>
Subject: Re: [RFC] kvm: x86: export vCPU halted state to sysfs
Date: Fri, 2 Feb 2018 09:14:26 -0500	[thread overview]
Message-ID: <20180202091426.3d02bcad@redhat.com> (raw)
In-Reply-To: <edc27e9a-9660-eed0-dd03-016fa2e966b7@linux.vnet.ibm.com>

On Fri, 2 Feb 2018 14:53:50 +0100
Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> wrote:

> On 01.02.2018 21:26, Eduardo Habkost wrote:
> > On Thu, Feb 01, 2018 at 09:15:15PM +0100, Radim Krčmář wrote:  
> >> 2018-02-01 12:54-0500, Luiz Capitulino:  
> >>>
> >>> Libvirt needs to know when a vCPU is halted. To get this information,  
> >>
> >> I don't see why upper level management should care about that, a single
> >> bit about halted state that can be incorrect at the time it is processed
> >> seems of very limited use.  
> > 
> > I don't see why, either.
> > 
> > I'm CCing libvir-list and the people involved in the code that
> > added halt state to libvirt domain statistics.
> >   
> I'll try to explain the motivation for the "halted" state exposure and
> why it ended int the libvirt domain stats.
> 
> s390 CPUs can be present in a system (e.g. after being hotplugged) but
> be offline (disabled) in which case they are not used by the operating
> system. In Linux disabled CPUs show a value of '0' in
> /sys/devices/system/cpu/cpu<n>/online.

If that's all you want, have you considered using the guest agent?

> Higher level management software (on top of libvirt) can take advantage
> of knowing whether a guest CPU is online and thus used or not.
> Specifically it might not make sense to plug more CPUs if the guest OS
> isn't using the CPUs at all.

OK, so what's the algorithm used by the higher level management
software where this all fits together? Something like:

1. Hotplug vCPU
2. Poll "halted" state
3. If "halted" becomes true, hotplug more vCPUs
4. If "halted" never becomes true, don't hotplug more CPUs

If that's the case, then I guess grepping for State in
/proc/qemu-pid/threadid/status will have the same end result, no?

> 
> A disabled guest CPU is represented as halted in the QEMU object model
> and can therefore be identified by the QMP query-cpus command.
> 
> The initial patch proposal to expose this via virsh vcpuinfo was not
> considered to be desirable because there was a concern that legacy
> management software might be confused seeing halted vcpus. Therefore the
> state information was added to the cpu domain statistics.
> 
> One issue we're facing is that the semantics of "halted" are different
> between s390 and at least x86. The question might be whether they are
> different enough to grant a specific "disabled" indicator.
> 
> [...]
> 

  reply	other threads:[~2018-02-02 14:14 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 17:54 [RFC] kvm: x86: export vCPU halted state to sysfs Luiz Capitulino
2018-02-01 20:15 ` Radim Krčmář
2018-02-01 20:26   ` Eduardo Habkost
2018-02-02 13:53     ` Viktor Mihajlovski
2018-02-02 14:14       ` Luiz Capitulino [this message]
2018-02-02 14:15       ` Eduardo Habkost
2018-02-02 14:19         ` Daniel P. Berrangé
2018-02-02 14:21           ` Luiz Capitulino
2018-02-02 14:50             ` Eduardo Habkost
2018-02-02 14:55               ` [libvirt] " Luiz Capitulino
2018-02-02 15:07               ` Daniel P. Berrangé
2018-02-02 15:25                 ` Eduardo Habkost
2018-02-02 16:23                   ` [libvirt] " Eric Blake
2018-02-02 15:19               ` Eric Blake
2018-02-02 17:23               ` [Qemu-devel] " Dr. David Alan Gilbert
2018-02-02 17:38                 ` Eduardo Habkost
2018-02-02 15:08         ` Viktor Mihajlovski
2018-02-02 15:22           ` [libvirt] " Luiz Capitulino
2018-02-02 15:51             ` Viktor Mihajlovski
2018-02-02 15:54               ` Daniel P. Berrangé
2018-02-02 16:01                 ` Luiz Capitulino
2018-02-02 16:07                   ` Luiz Capitulino
2018-02-02 16:19                   ` Viktor Mihajlovski
2018-02-02 17:42                     ` [libvirt] " Eduardo Habkost
2018-02-02 18:50                       ` Luiz Capitulino
2018-02-02 20:09                         ` Eduardo Habkost
2018-02-02 20:19                           ` [libvirt] " Luiz Capitulino
2018-02-02 20:41                             ` Eduardo Habkost
2018-02-02 21:49                               ` Luiz Capitulino
2018-02-02 21:54                                 ` Luiz Capitulino
2018-02-05 13:43                               ` Viktor Mihajlovski
2018-02-05 13:47                                 ` Daniel P. Berrangé
2018-02-05 15:37                                   ` Luiz Capitulino
2018-02-05 16:10                                     ` Viktor Mihajlovski
2018-02-05 16:36                                       ` Luiz Capitulino
2018-02-05 22:50                                     ` Eduardo Habkost
2018-02-06  2:04                                       ` Luiz Capitulino
2018-02-02 15:55               ` [libvirt] " Luiz Capitulino
2018-02-06 10:29     ` Viktor Mihajlovski
2018-02-06 14:05       ` Luiz Capitulino
2018-02-02 12:47   ` Daniel P. Berrangé
2018-02-02 13:46     ` Luiz Capitulino
2018-02-02 12:49 ` Daniel P. Berrangé
2018-02-02 13:49   ` Luiz Capitulino

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=20180202091426.3d02bcad@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=jferlan@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=libvir-list@redhat.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=rkrcmar@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox