[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFCv1 4/8] kvm: Introduce secondary dirty bitmap
From: |
Juan Quintela |
Subject: |
Re: [PATCH RFCv1 4/8] kvm: Introduce secondary dirty bitmap |
Date: |
Wed, 08 Feb 2023 23:07:42 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Gavin Shan <gshan@redhat.com> wrote:
> When dirty ring is enabled on ARM64, the backup bitmap may be used
> to track the dirty pages in no-running-vcpu situations. The original
> bitmap is the primary one, used for the dirty ring buffer. We need
> the secondary bitmap to collect the backup bitmap for ARM64.
>
> No functional change intended.
>
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
> accel/kvm/kvm-all.c | 50 ++++++++++++++++++++++++++++++----------
> include/sysemu/kvm_int.h | 1 +
> 2 files changed, 39 insertions(+), 12 deletions(-)
>
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 01a6a026af..1a93985574 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -553,13 +553,29 @@ static void kvm_log_stop(MemoryListener *listener,
> }
> }
>
> +static unsigned long *kvm_slot_dirty_bitmap(KVMSlot *slot, bool primary)
> +{
> + if (primary) {
> + return slot->dirty_bmap;
> + }
> +
> + return slot->dirty_bmap +
> + slot->dirty_bmap_size / sizeof(slot->dirty_bmap[0]);
> +}
Why?
Just use two bitmaps and call it a day.
Later, Juan.
- [PATCH RFCv1 0/8] hw/arm/virt: Support dirty ring, Gavin Shan, 2023/02/06
- [PATCH RFCv1 1/8] linux-headers: Update for dirty ring, Gavin Shan, 2023/02/06
- [PATCH RFCv1 2/8] memory: Add last stage indicator to global dirty log synchronization, Gavin Shan, 2023/02/06
- [PATCH RFCv1 3/8] migration: Add last stage indicator to global dirty log synchronization, Gavin Shan, 2023/02/06
- [PATCH RFCv1 4/8] kvm: Introduce secondary dirty bitmap, Gavin Shan, 2023/02/06
- Re: [PATCH RFCv1 4/8] kvm: Introduce secondary dirty bitmap,
Juan Quintela <=
- [PATCH RFCv1 8/8] kvm: Enable dirty ring for arm64, Gavin Shan, 2023/02/06
- [PATCH RFCv1 6/8] kvm: Add helper kvm_dirty_ring_init(), Gavin Shan, 2023/02/06
- [PATCH RFCv1 5/8] kvm: Synchronize secondary bitmap in last stage, Gavin Shan, 2023/02/06
- [PATCH RFCv1 7/8] hw/arm/virt: Enable backup bitmap for dirty ring, Gavin Shan, 2023/02/06