[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 38/40] migration: update index field when delete or q
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 38/40] migration: update index field when delete or qsort RDMALocalBlock |
Date: |
Wed, 16 May 2018 01:40:15 +0200 |
From: Lidong Chen <address@hidden>
rdma_delete_block function deletes RDMALocalBlock base on index field,
but not update the index field. So when next time invoke rdma_delete_block,
it will not work correctly.
If start and cancel migration repeatedly, some RDMALocalBlock not invoke
ibv_dereg_mr to decrease kernel mm_struct vmpin. When vmpin is large than
max locked memory limitation, ibv_reg_mr will failed, and migration can not
start successfully again.
Signed-off-by: Lidong Chen <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Lidong Chen <address@hidden>
---
migration/rdma.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/migration/rdma.c b/migration/rdma.c
index da474fc19f..7d233b0820 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -708,6 +708,9 @@ static int rdma_delete_block(RDMAContext *rdma,
RDMALocalBlock *block)
memcpy(local->block + block->index, old + (block->index + 1),
sizeof(RDMALocalBlock) *
(local->nb_blocks - (block->index + 1)));
+ for (x = block->index; x < local->nb_blocks - 1; x++) {
+ local->block[x].index--;
+ }
}
} else {
assert(block == local->block);
@@ -3246,6 +3249,10 @@ static int qemu_rdma_registration_handle(QEMUFile *f,
void *opaque)
qsort(rdma->local_ram_blocks.block,
rdma->local_ram_blocks.nb_blocks,
sizeof(RDMALocalBlock), dest_ram_sort_func);
+ for (i = 0; i < local->nb_blocks; i++) {
+ local->block[i].index = i;
+ }
+
if (rdma->pin_all) {
ret = qemu_rdma_reg_whole_ram_blocks(rdma);
if (ret) {
--
2.17.0
- [Qemu-devel] [PULL 27/40] migration: introduce SaveVMHandlers.resume_prepare, (continued)
- [Qemu-devel] [PULL 27/40] migration: introduce SaveVMHandlers.resume_prepare, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 30/40] migration: final handshake for the resume, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 31/40] migration: init dst in migration_object_init too, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 28/40] migration: synchronize dirty bitmap for resume, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 29/40] migration: setup ramstate for resume, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 32/40] qmp/migration: new command migrate-recover, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 33/40] hmp/migration: add migrate_recover command, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 34/40] migration: introduce lock for to_dst_file, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 35/40] migration/qmp: add command migrate-pause, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 36/40] migration/hmp: add migrate_pause command, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 38/40] migration: update index field when delete or qsort RDMALocalBlock,
Juan Quintela <=
- [Qemu-devel] [PULL 39/40] migration: Textual fixups for blocktime, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 37/40] migration: update docs, Juan Quintela, 2018/05/15
- [Qemu-devel] [PULL 40/40] Migration+TLS: Fix crash due to double cleanup, Juan Quintela, 2018/05/15
- Re: [Qemu-devel] [PULL 00/40] Migration PULL requset (take 2), Peter Maydell, 2018/05/17