From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Laszlo Ersek <lersek@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Peter Xu <peterx@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH RFC] memory: pause all vCPUs for the duration of memory transactions
Date: Tue, 27 Oct 2020 14:19:01 +0100 [thread overview]
Message-ID: <875z6v24e2.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <e1d85d86-fb2f-d2a8-77ea-1e0d48c8fb67@redhat.com>
David Hildenbrand <david@redhat.com> writes:
> On 27.10.20 14:02, Vitaly Kuznetsov wrote:
>>
>> Sorry for not being clear: your patch looks good to me, what I tried to
>> say is that with the current KVM API the only way to guarantee atomicity
>> of the update is to make vCPUs stop (one way or another), kicking them
>> out and preventing new IOCTLs from being dispatched is one way
>> (temporary pausing them inside KVM would be another, for example -- but
>> that would require *new* API supplying the whole transaction and not one
>> memslot update).
>
> Ah, got it.
>
> Yes - and I briefly looked into resizing slots inside KVM atomically and
> it already turned out to be a major pain. All that metadata that's
> allocated for a memory slot based on the size is problematic.
>
Yep, exactly and personally I'd rather refrain from doing more tricks
within KVM to keep the code simple. Generally, memslot updates should't
happen very often so pausing and resuming vCPUs should be acceptable
(that was one of the questions for this RFC).
Overall, I think we're in violent agreement here)
> Same applies to all other kinds of operations (splitting, punching out,
> ...) as you also mentioned.
One question from a QEMU newbie though: why do you put
kvm_ioctl_inhibit_begin()/kvm_ioctl_inhibit_end() to kvm_region_resize()
only and not taking it all the way up to
memory_region_transaction_begin()/memory_region_transaction_end() to
support atomicity for all kinds of updates right away?
The second question is whether you plan to sumbit this any time soon)
Thanks!
--
Vitaly
next prev parent reply other threads:[~2020-10-27 13:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 8:49 [PATCH RFC] memory: pause all vCPUs for the duration of memory transactions Vitaly Kuznetsov
2020-10-26 10:43 ` David Hildenbrand
2020-10-26 11:17 ` David Hildenbrand
2020-10-27 12:36 ` Vitaly Kuznetsov
2020-10-27 12:42 ` David Hildenbrand
2020-10-27 13:02 ` Vitaly Kuznetsov
2020-10-27 13:08 ` David Hildenbrand
2020-10-27 13:19 ` Vitaly Kuznetsov [this message]
2020-10-27 13:35 ` David Hildenbrand
2020-10-27 13:47 ` Vitaly Kuznetsov
2020-10-27 14:20 ` Igor Mammedov
2020-11-02 19:57 ` Peter Xu
2020-11-03 13:07 ` Vitaly Kuznetsov
2020-11-03 16:37 ` Peter Xu
2020-11-04 18:09 ` Laszlo Ersek
2020-11-04 19:23 ` Peter Xu
2020-11-05 15:36 ` Vitaly Kuznetsov
2020-11-05 16:35 ` Peter Xu
2020-11-04 17:58 ` Laszlo Ersek
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=875z6v24e2.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).