public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: darkhan@amazon.com
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, corbet@lwn.net,
	james.morse@arm.com, catalin.marinas@arm.com, chenhc@lemote.com,
	paulus@ozlabs.org, frankja@linux.ibm.com, mingo@redhat.com,
	acme@redhat.com, graf@amazon.de, darkhan@amazon.de
Subject: Re: [PATCH 0/3] Introduce new vcpu ioctls KVM_(GET|SET)_MANY_REGS
Date: Mon, 23 Nov 2020 11:39:47 +0000	[thread overview]
Message-ID: <287408cf179690f975daa4f665926d66@kernel.org> (raw)
In-Reply-To: <20201120125616.14436-1-darkhan@amazon.com>

On 2020-11-20 12:56, darkhan@amazon.com wrote:
> From: Darkhan Mukashov <darkhan@amazon.com>
> 
> The ultimate goal is to introduce new vcpu ioctls 
> KVM_(GET|SET)_MANY_REGS.
> To introduce these ioctls, implementations of KVM_(GET|SET)_ONE_REG 
> have
> to be refactored. Specifically, KVM_(GET|SET)_ONE_REG should be handled 
> in
> a generic kvm_vcpu_ioctl function.
> 
> New KVM APIs KVM_(GET|SET)_MANY_REGS make it possible to bulk 
> read/write
> vCPU registers at one ioctl call. These ioctls can be very useful when
> vCPU state serialization/deserialization is required (e.g. live update 
> of
> kvm, live migration of guests), hence all registers have to be
> saved/restored. KVM_(GET|SET)_MANY_REGS will help avoid performance
> overhead associated with syscall (ioctl in our case) handling. Tests
> conducted on AWS Graviton2 Processors (64-bit ARM Neoverse cores) show
> that average save/restore time of all vCPU registers can be optimized
> ~3.5 times per vCPU with new ioctls. Test results can be found in Table 
> 1.
> +---------+-------------+---------------+
> |         | kvm_one_reg | kvm_many_regs |
> +---------+-------------+---------------+
> | get all |   123 usec  |    33 usec    |
> +---------+-------------+---------------+
> | set all |   120 usec  |    36 usec    |
> +---------+-------------+---------------+
> 	Table 1. Test results

I have asked in private last week, and didn't get a satisfying answer:

We are talking about 90us over the time taken by enough state to be
transferred to the target so that it can be restarted. What proportion
does this represent? I'd expect userspace to do this from the vcpu
thread, and thus to be able to do everything in parallel, in which case
the gain doesn't scale with the number of vcpu.

One of the reasons for me being reluctant is that the userspace API
breaks extremely often, and that you are now adding yet another one
that can be used concurrently with the existing one.

So I would really like to see the whole picture, and not just this
very narrow "make it faster" approach. I also want to understand
why this is a "MANY" approach, and not "ALL".

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

      parent reply	other threads:[~2020-11-23 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 12:56 [PATCH 0/3] Introduce new vcpu ioctls KVM_(GET|SET)_MANY_REGS darkhan
2020-11-20 12:56 ` [PATCH 1/3] Documentation: KVM: change description of vcpu ioctls KVM_(GET|SET)_ONE_REG darkhan
2020-11-20 12:56 ` [PATCH 2/3] KVM: handle vcpu ioctls KVM_(GET|SET)_ONE_REG in a generic function darkhan
2020-11-20 12:56 ` [PATCH 3/3] KVM: introduce new vcpu ioctls KVM_GET_MANY_REGS and KVM_SET_MANY_REGS darkhan
2020-11-23 11:39 ` Marc Zyngier [this message]

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=287408cf179690f975daa4f665926d66@kernel.org \
    --to=maz@kernel.org \
    --cc=acme@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=chenhc@lemote.com \
    --cc=corbet@lwn.net \
    --cc=darkhan@amazon.com \
    --cc=darkhan@amazon.de \
    --cc=frankja@linux.ibm.com \
    --cc=graf@amazon.de \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@ozlabs.org \
    --cc=pbonzini@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