diff options
author | Peter Lieven <pl@kamp.de> | 2013-10-24 09:21:29 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2013-11-19 17:23:57 +0100 |
commit | fc1c4a5d32e15a4c40c47945da85ef9c1e0c1b54 (patch) | |
tree | 29b83122d96f514137440567ad92c38cacf2c2cc /arch_init.c | |
parent | 5c5432e7d630592ddcc1876ac8a1505f8f14ef15 (diff) | |
download | qemu-fc1c4a5d32e15a4c40c47945da85ef9c1e0c1b54.tar.gz qemu-fc1c4a5d32e15a4c40c47945da85ef9c1e0c1b54.tar.bz2 qemu-fc1c4a5d32e15a4c40c47945da85ef9c1e0c1b54.zip |
migration: drop MADVISE_DONT_NEED for incoming zero pages
The madvise for zeroed out pages was introduced when every transferred
zero page was memset to zero and thus allocated. Since commit
211ea740 we check for zeroness of a target page before we memset
it to zero. Additionally we memmap target memory so it is essentially
zero initialized (except for e.g. option roms and bios which are loaded
into target memory although they shouldn't).
It was reported recently that this madvise causes a performance degradation
in some situations. As the madvise should only be called rarely and if it's called
it is likely on a busy page (it was non-zero and changed to zero during migration)
drop it completely.
Reported-By: Zhang Haoyu <haoyu.zhang@huawei.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r-- | arch_init.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/arch_init.c b/arch_init.c index 7545d96739..e0acbc5661 100644 --- a/arch_init.c +++ b/arch_init.c @@ -850,14 +850,6 @@ void ram_handle_compressed(void *host, uint8_t ch, uint64_t size) { if (ch != 0 || !is_zero_range(host, size)) { memset(host, ch, size); -#ifndef _WIN32 - if (ch == 0 && (!kvm_enabled() || kvm_has_sync_mmu())) { - size = size & ~(getpagesize() - 1); - if (size > 0) { - qemu_madvise(host, size, QEMU_MADV_DONTNEED); - } - } -#endif } } |