[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 01/15] migration: Take bitmap mutex when completing ram mi
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH v2 01/15] migration: Take bitmap mutex when completing ram migration |
Date: |
Wed, 12 Oct 2022 17:14:14 +0100 |
User-agent: |
Mutt/2.2.7 (2022-08-07) |
* Peter Xu (peterx@redhat.com) wrote:
> Any call to ram_find_and_save_block() needs to take the bitmap mutex. We
> used to not take it for most of ram_save_complete() because we thought
> we're the only one left using the bitmap, but it's not true after the
> preempt full patchset applied, since the return path can be taking it too.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> migration/ram.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 1338e47665..cfeb571800 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3406,6 +3406,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
> /* try transferring iterative blocks of memory */
>
> /* flush all remaining blocks regardless of rate limiting */
> + qemu_mutex_lock(&rs->bitmap_mutex);
> while (true) {
> int pages;
>
> @@ -3419,6 +3420,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
> break;
> }
> }
> + qemu_mutex_unlock(&rs->bitmap_mutex);
>
> flush_compressed_data(rs);
> ram_control_after_iterate(f, RAM_CONTROL_FINISH);
> --
> 2.37.3
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [PATCH v2 00/15] migration: Postcopy Preempt-Full, Peter Xu, 2022/10/11
- [PATCH v2 01/15] migration: Take bitmap mutex when completing ram migration, Peter Xu, 2022/10/11
- Re: [PATCH v2 01/15] migration: Take bitmap mutex when completing ram migration,
Dr. David Alan Gilbert <=
- [PATCH v2 02/15] migration: Add postcopy_preempt_active(), Peter Xu, 2022/10/11
- [PATCH v2 03/15] migration: Cleanup xbzrle zero page cache update logic, Peter Xu, 2022/10/11
- [PATCH v2 04/15] migration: Trivial cleanup save_page_header() on same block check, Peter Xu, 2022/10/11
- [PATCH v2 06/15] migration: Yield bitmap_mutex properly when sending/sleeping, Peter Xu, 2022/10/11
[PATCH v2 10/15] migration: Add pss_init(), Peter Xu, 2022/10/11
[PATCH v2 05/15] migration: Remove RAMState.f references in compression code, Peter Xu, 2022/10/11