[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75243b83-f85d-3d51-7df4-3e95abbb7ef4@redhat.com>
Date: Thu, 29 Sep 2022 18:00:56 +0200
From: David Hildenbrand <david@...hat.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>
Cc: Emanuele Giuseppe Esposito <eesposit@...hat.com>,
Maxim Levitsky <mlevitsk@...hat.com>, kvm@...r.kernel.org,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
Like Xu <like.xu.linux@...il.com>
Subject: Re: [RFC PATCH 0/9] kvm: implement atomic memslot updates
> The main cases are:
>
> - for the boot case, splitting and merging existing memslots. QEMU
> likes to merge adjacent memory regions into a single memslot, so if
> something goes from read-write to read-only it has to be split and vice
> versa. I guess a "don't merge this memory region" flag would be the
> less hideous way to solve it in userspace.
>
> - however, there is also the case of resizing an existing memslot which
> is what David would like to have for virtio-mem. This is not really
> fixable because part of the appeal of virtio-mem is to have a single
> huge memslot instead of many smaller ones, in order to reduce the
> granularity of add/remove (David, correct me if I'm wrong).
Yes, the most important case I am working on in that regard is reducing
the memslot size/overhead when only exposing comparatively little memory
towards a VM using virtio-mem (say, a virtio-mem device that could grow
to 1 TiB, but we initially only expose 1 GiB to the VM).
One approach I prototyped in the past (where my RFC for atomic updates
came into play because I ran into this issue) to achieve that was
dynamically growing (and eventually shrinking) a single memslot on demand.
An alternative [1] uses multiple individual memslots, and exposes them
on demand. There, I have to make sure that QEMU won't merge adjacent
memslots into a bigger one -- because otherwise, we'd again need atomic
memslot updates again, which KVM, vhost-user, ... don't support. But in
the future, I think we want to have that: if there is no fragmentation,
we should only have a single large memslot and all memslot consumers
should be able to cope with atomic updates.
So in any case, I will have good use for atomic memslot updates. Just
like other hypervisors that (will) implement virtio-mem or something
comparable :)
[1] https://lore.kernel.org/all/20211013103330.26869-1-david@redhat.com/T/#u
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists