[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] migration: update index field when delete o
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] migration: update index field when delete or qsort RDMALocalBlock |
Date: |
Tue, 8 May 2018 18:19:42 +0100 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
* Lidong Chen (address@hidden) wrote:
> 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>
> ---
> migration/rdma.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index ed9cfb1..0dd4033 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -713,6 +713,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--;
> + }
Yes; is that equivalent to local->blocks[x].index = x; ?
> }
> } else {
> assert(block == local->block);
> @@ -3398,6 +3401,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;
> + }
> +
Which is basically the way that one does it;
OK, it's a while since I looked at this but I think it fixes my 3 year
old 03fcab38617 patch, so
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> if (rdma->pin_all) {
> ret = qemu_rdma_reg_whole_ram_blocks(rdma);
> if (ret) {
> --
> 1.8.3.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, (continued)
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, 858585 jemmy, 2018/05/16
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, Dr. David Alan Gilbert, 2018/05/16
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, 858585 jemmy, 2018/05/16
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, Dr. David Alan Gilbert, 2018/05/16
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, 858585 jemmy, 2018/05/16
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, Dr. David Alan Gilbert, 2018/05/16
- Message not available
- Message not available
- Message not available
- Re: [Qemu-devel] FW: [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, Aviad Yehezkel, 2018/05/17
- Re: [Qemu-devel] FW: [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, 858585 jemmy, 2018/05/17
- Re: [Qemu-devel] FW: [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, Aviad Yehezkel, 2018/05/17
- Re: [Qemu-devel] [PATCH 2/2] migration: not wait RDMA_CM_EVENT_DISCONNECTED event after rdma_disconnect, 858585 jemmy, 2018/05/22
Re: [Qemu-devel] [PATCH 1/2] migration: update index field when delete or qsort RDMALocalBlock,
Dr. David Alan Gilbert <=