From: Luiz Capitulino <lcapitulino@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Peter Krempa" <pkrempa@redhat.com>,
kvm@vger.kernel.org, ář <rkrcmar@redhat.com>,
libvir-list@redhat.com,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
pbonzini@redhat.com
Subject: Re: [libvirt] [RFC] kvm: x86: export vCPU halted state to sysfs
Date: Fri, 2 Feb 2018 15:19:45 -0500 [thread overview]
Message-ID: <20180202151945.52847f8e@redhat.com> (raw)
In-Reply-To: <20180202200912.GP26425@localhost.localdomain>
On Fri, 2 Feb 2018 18:09:12 -0200
Eduardo Habkost <ehabkost@redhat.com> wrote:
> On Fri, Feb 02, 2018 at 01:50:33PM -0500, Luiz Capitulino wrote:
> > On Fri, 2 Feb 2018 15:42:49 -0200
> > Eduardo Habkost <ehabkost@redhat.com> wrote:
> >
> > > On Fri, Feb 02, 2018 at 05:19:34PM +0100, Viktor Mihajlovski wrote:
> > > > On 02.02.2018 17:01, Luiz Capitulino wrote:
> > > [...]
> > > > > o Make qemuDomainRefreshVcpuHalted() s390-only in libvirt. This by
> > > > > itself fixes the original performance issue
> > > > We are normally trying to avoid architecture-specific code in libvirt
> > > > (not always successfully). We could omit the call, based on a QEMU
> > > > Capability derived from the presence of said flag. This would change the
> > > > libvirt-client side default to not report halted. A client can the still
> > > > request the value via a tbd libvirt flag. Which is what an s390-aware
> > > > management app would have to do...
> > >
> > > The problem I see here is that the current semantics of the
> > > "halted" field in QEMU is arch-specific, so either libvirt or
> > > upper layers will necessarily need arch-specific code if they
> > > want to support QEMU 2.11 or older.
> >
> > My understanding of this plan is:
> >
> > 1. Deprecate the "halted" field in query-cpus (that is, make it
> > always return halted=false)
>
> I don't think we really need to do this. If we do, this should
> be the last step (after libvirt is already using the new
> interfaces).
Yeah, I've just started taking a look on how to implement this
plan I my first conclusion was to let current query-cpus alone.
> > 2. Add a new command, say query-cpu-state, which is arch dependent
> > and is only available in archs that support sane "halted"
> > semantics (I guess we can have per-arch QMP commands, right?)
>
> I don't see why we would make the new command arch-dependent. We
> need two new interfaces:
>
> 1) A lightweight version of query-cpus that won't interrupt the
> VCPUs. This can be a new command, or a new parameter to
> query-cpus.
Exactly how I thought of doing it. I prefer a new command so that
we untangle this from query-cpus.
> 2) A arch-independent way to query "CPU is online" state, as the
> existing "halted" field has confusing arch-specific semantics.
Honest question: is it at all possible for QEMU to know a CPU
is online? My impression is that the halted thing is the best
we can do. If we need better than this, then libvirt should use
the guest agent instead.
Btw, I haven't checked all archs yet, but I'm under the impression
the halted thing is confusing in x86 because of the in kernel irqchip.
Otherwise this state is maintained be qemu itself.
> > 3. Modify libvirt to use query-cpu-state if it's available,
> > otherwise use query-cpus (in which case "halted" will be bogus,
> > but that's a feature :) )
> >
> > In essence, we're moving the arch-specific code from libvirt to
> > qemu.
>
> Your plan above covers what will happen when using newer QEMU
> versions, but libvirt still needs to work sanely if running QEMU
> 2.11. My suggestion is that libvirt do not run query-cpus to ask
> for the "halted" field on any architecture except s390.
My current plan is to ask libvirt to completely remove query-cpus
usage, independent of the arch and use the new command instead.
next prev parent reply other threads:[~2018-02-02 20:19 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
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 ` Luiz Capitulino [this message]
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=20180202151945.52847f8e@redhat.com \
--to=lcapitulino@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=libvir-list@redhat.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