[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] Migration thread mutex
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] Migration thread mutex |
Date: |
Mon, 29 Aug 2011 10:04:55 +0100 |
On Sat, Aug 27, 2011 at 7:09 PM, Umesh Deshpande <address@hidden> wrote:
> This patch implements migrate_ram mutex, which protects the RAMBlock list
> traversal in the migration thread during the transfer of a ram from their
> addition/removal from the iothread.
>
> Note: Combination of iothread mutex and migration thread mutex works as a
> rw-lock. Both mutexes are acquired while modifying the ram_list members or RAM
> block list.
>
> Signed-off-by: Umesh Deshpande <address@hidden>
> ---
> arch_init.c | 21 +++++++++++++++++++++
> cpu-all.h | 3 +++
> exec.c | 23 +++++++++++++++++++++++
> qemu-common.h | 2 ++
> 4 files changed, 49 insertions(+), 0 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 484b39d..9d02270 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -109,6 +109,7 @@ static int is_dup_page(uint8_t *page, uint8_t ch)
>
> static RAMBlock *last_block;
> static ram_addr_t last_offset;
> +static uint64_t last_version;
[...]
> typedef struct RAMList {
> + QemuMutex mutex; /* Protects RAM block list */
> uint8_t *phys_dirty;
> + uint32_t version; /* To detect ram block addition/removal */
Is there a reason why RAMList.version is uint32_t but last_version is uint64_t?
Stefan
- [Qemu-devel] [PATCH 0/5] Separate thread for VM migration, Umesh Deshpande, 2011/08/27
- [Qemu-devel] [PATCH 1/5] Support for vm_stop from the migration thread, Umesh Deshpande, 2011/08/27
- [Qemu-devel] [PATCH 4/5] Separate migration dirty bitmap, Umesh Deshpande, 2011/08/27
- [Qemu-devel] [PATCH 3/5] Migration thread mutex, Umesh Deshpande, 2011/08/27
- [Qemu-devel] [PATCH 2/5] MRU ram block list, Umesh Deshpande, 2011/08/27
- [Qemu-devel] [PATCH 5/5] Separate migration thread, Umesh Deshpande, 2011/08/27
- Re: [Qemu-devel] [PATCH 0/5] Separate thread for VM migration, Paolo Bonzini, 2011/08/29