migration: stop decompression to allocate and free memory frequently
commit797ca154b4c68dbd8e93382f714388ab311f672d
authorXiao Guangrong <xiaoguangrong@tencent.com>
Fri, 30 Mar 2018 07:51:21 +0000 (30 15:51 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 25 Apr 2018 17:04:07 +0000 (25 18:04 +0100)
tree49bdb088879f888ed6f7afa26681b373766436bd
parentdcaf446ebda5d87e05eb41cdbafb7ae4a7cc4a62
migration: stop decompression to allocate and free memory frequently

Current code uses uncompress() to decompress 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

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

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-4-xiaoguangrong@tencent.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/ram.c