[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RESEND v2 07/18] COLO: Load dirty pages into SVM
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH RESEND v2 07/18] COLO: Load dirty pages into SVM's RAM cache firstly |
Date: |
Mon, 24 Apr 2017 20:27:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
zhanghailiang <address@hidden> wrote:
> We should not load PVM's state directly into SVM, because there maybe some
> errors happen when SVM is receving data, which will break SVM.
>
> We need to ensure receving all data before load the state into SVM. We use
> an extra memory to cache these data (PVM's ram). The ram cache in secondary
> side
> is initially the same as SVM/PVM's memory. And in the process of checkpoint,
> we cache the dirty pages of PVM into this ram cache firstly, so this ram cache
> always the same as PVM's memory at every checkpoint, then we flush this
> cached ram
> to SVM after we receive all PVM's state.
>
> Cc: Dr. David Alan Gilbert <address@hidden>
> Signed-off-by: zhanghailiang <address@hidden>
> Signed-off-by: Li Zhijian <address@hidden>
> ---
> v2:
> - Move colo_init_ram_cache() and colo_release_ram_cache() out of
> incoming thread since both of them need the global lock, if we keep
> colo_release_ram_cache() in incoming thread, there are potential
> dead-lock.
> - Remove bool ram_cache_enable flag, use migration_incoming_in_state()
> instead.
> - Remove the Reviewd-by tag because of the above changes.
> +out_locked:
> + QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
> + if (block->colo_cache) {
> + qemu_anon_ram_free(block->colo_cache, block->used_length);
> + block->colo_cache = NULL;
> + }
> + }
> +
> + rcu_read_unlock();
> + return -errno;
> +}
> +
> +/* It is need to hold the global lock to call this helper */
> +void colo_release_ram_cache(void)
> +{
> + RAMBlock *block;
> +
> + rcu_read_lock();
> + QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
> + if (block->colo_cache) {
> + qemu_anon_ram_free(block->colo_cache, block->used_length);
> + block->colo_cache = NULL;
> + }
> + }
> + rcu_read_unlock();
> +}
Create a function from the creation/removal? We have exactly two copies
of the same code. Right now the code inside the function is very small,
but it could be bigger, no?
Later, Juan.
- [Qemu-devel] [PATCH RESEND v2 00/18] COLO: integrate colo frame with block replication and net compare, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 01/18] net/colo: Add notifier/callback related helpers for filter, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 02/18] colo-compare: implement the process of checkpoint, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 07/18] COLO: Load dirty pages into SVM's RAM cache firstly, zhanghailiang, 2017/04/22
- Re: [Qemu-devel] [PATCH RESEND v2 07/18] COLO: Load dirty pages into SVM's RAM cache firstly,
Juan Quintela <=
- [Qemu-devel] [PATCH RESEND v2 05/18] COLO: Handle shutdown command for VM in COLO state, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 13/18] COLO: Separate the process of saving/loading ram and device state, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 11/18] savevm: split save/find loadvm_handlers entry into two helper functions, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 04/18] COLO: integrate colo compare with colo frame, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 12/18] savevm: split the process of different stages for loadvm/savevm, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 15/18] COLO: flush host dirty ram from cache, zhanghailiang, 2017/04/22
- [Qemu-devel] [PATCH RESEND v2 09/18] COLO: Flush memory data from ram cache, zhanghailiang, 2017/04/22