]> git.proxmox.com Git - mirror_qemu.git/commit - migration/qemu-file.c
migration: stop compression to allocate and free memory frequently
authorXiao Guangrong <xiaoguangrong@tencent.com>
Fri, 30 Mar 2018 07:51:20 +0000 (15:51 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 25 Apr 2018 17:04:06 +0000 (18:04 +0100)
commitdcaf446ebda5d87e05eb41cdbafb7ae4a7cc4a62
tree4b798711f89fc9803ad553b521d0d26b68958351
parent263a289ae61c8344a417a95b0142650fdff3af56
migration: stop compression to allocate and free memory frequently

Current code uses compress2() to compress memory which manages memory
internally, that causes huge memory is allocated and freed very
frequently

More worse, frequently returning memory to kernel will flush TLBs
and trigger invalidation callbacks on mmu-notification which
interacts with KVM MMU, that dramatically reduce the performance
of VM

So, we maintain the memory by ourselves and reuse it for each
compression

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>
Message-Id: <20180330075128.26919-3-xiaoguangrong@tencent.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/qemu-file.c
migration/qemu-file.h
migration/ram.c