[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_
From: |
Denis V. Lunev |
Subject: |
[Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0 |
Date: |
Fri, 25 Sep 2015 12:09:39 +0300 |
we can omit calling of bitmap_set in migration_bitmap_extend and
ram_save_setup just after bitmap_new, which properly zeroes memory
inside.
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Igor Redko <address@hidden>
CC: Anna Melekhova <address@hidden>
CC: Juan Quintela <address@hidden>
CC: Amit Shah <address@hidden>
CC: Wen Congyang <address@hidden>
---
migration/ram.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 7f007e6..a712c68 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1081,7 +1081,6 @@ void migration_bitmap_extend(ram_addr_t old, ram_addr_t
new)
*/
qemu_mutex_lock(&migration_bitmap_mutex);
bitmap_copy(bitmap, old_bitmap, old);
- bitmap_set(bitmap, old, new - old);
atomic_rcu_set(&migration_bitmap, bitmap);
qemu_mutex_unlock(&migration_bitmap_mutex);
migration_dirty_pages += new - old;
@@ -1146,7 +1145,6 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
ram_bitmap_pages = last_ram_offset() >> TARGET_PAGE_BITS;
migration_bitmap = bitmap_new(ram_bitmap_pages);
- bitmap_set(migration_bitmap, 0, ram_bitmap_pages);
/*
* Count the total number of pages used by ram blocks not including any
--
2.1.4
- [Qemu-devel] [PATCH 1/1] migration: fix deadlock, Denis V. Lunev, 2015/09/24
- Re: [Qemu-devel] [PATCH 1/1] migration: fix deadlock, Wen Congyang, 2015/09/24
- Re: [Qemu-devel] [PATCH 1/1] migration: fix deadlock, Denis V. Lunev, 2015/09/25
- Re: [Qemu-devel] [PATCH 1/1] migration: fix deadlock, Wen Congyang, 2015/09/25
- [Qemu-devel] [PATCH v2 0/2] migration: fix deadlock, Denis V. Lunev, 2015/09/25
- [Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0,
Denis V. Lunev <=
- Re: [Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0, Wen Congyang, 2015/09/25
- Re: [Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0, Denis V. Lunev, 2015/09/25
- Re: [Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0, Wen Congyang, 2015/09/25
- Re: [Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0, Denis V. Lunev, 2015/09/25
- [Qemu-devel] [PATCH 2/2] migration: fix deadlock, Denis V. Lunev, 2015/09/25
- Re: [Qemu-devel] [PATCH 2/2] migration: fix deadlock, Wen Congyang, 2015/09/25
- Re: [Qemu-devel] [PATCH v2 0/2] migration: fix deadlock, Wen Congyang, 2015/09/25
- Re: [Qemu-devel] [PATCH v2 0/2] migration: fix deadlock, Igor Redko, 2015/09/29
- Re: [Qemu-devel] [PATCH v2 0/2] migration: fix deadlock, Igor Redko, 2015/09/29