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:47:14 +0100 [thread overview]
Message-ID: <87wnzbzspp.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <219ac264-dcd4-70f0-244f-1bee601aded7@redhat.com>
David Hildenbrand <david@redhat.com> writes:
>>> 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 clean way to implement it for
> memory_region_transaction_begin()/memory_region_transaction_end() is by
> implementing
> ->begin()
> ->commit()
> callbacks for the KVM MemoryListener, and doing it in there, in KVM code.
>
>
> Now, I wasn't sure how this might affect real-time workloads, where you
> really don't want to kick CPUs out of KVM. You can make a lot of
> operations without requiring this handling like
>
> 1. Adding regions (memory hotplug)
> 2. Removing regions (memory hotunplug)
> 3. Enabling/disabling dirty logging
>
> Resize/split(/move/...) are the problematic operations where we would
> need that handling. Modifying the size/location of existing slots.
>
> One way to tackle it would be to "sense" upfront if such "modifying"
> operations will be required, communicating that via "->begin()", and
> letting the KVM notifier decide based on that information whether to get
> everything out of KVM. Sounds feasible.
>
I don't actually know if we have such use-cases but thinking about
e.g. punching a hole in a middle of an existing slot requires:
1) Resizing the existing slot to its first half
2) Creating the hole
3) Creating a new slot for the second half of the slot.
In case we'd like to make this atomic, we need to cover the whole
transaction. But again, I don't know if we have a use-case for it or
not.
>>
>> The second question is whether you plan to sumbit this any time soon)
>
> Once we have an agreement on how to proceed, either I can try to
> dedicate some time, or if you have some time, you can pickup my work and
> make it also handle the other problematic cases (as discussed e.g., ^).
Ok, I plan to test your patch in the nearby future and if it works we
can start with just the 'resize' case as it seems to be causing real
issues. The infrastructure you create with kvm_ioctl_inhibit_begin()/
kvm_ioctl_inhibit_end() can be re-used later for other ops.
--
Vitaly
next prev parent reply other threads:[~2020-10-27 13:48 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
2020-10-27 13:35 ` David Hildenbrand
2020-10-27 13:47 ` Vitaly Kuznetsov [this message]
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=87wnzbzspp.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).