[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 45/65] ram: Pass RAMBlock to bitmap_sync
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 45/65] ram: Pass RAMBlock to bitmap_sync |
Date: |
Fri, 21 Apr 2017 13:56:26 +0200 |
We change the meaning of start to be the offset from the beggining of
the block.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
include/exec/ram_addr.h | 2 ++
migration/ram.c | 8 ++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 9aadc5c..8a1372c 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -354,11 +354,13 @@ static inline void
cpu_physical_memory_clear_dirty_range(ram_addr_t start,
static inline
uint64_t cpu_physical_memory_sync_dirty_bitmap(unsigned long *dest,
+ RAMBlock *rb,
ram_addr_t start,
ram_addr_t length,
uint64_t *real_dirty_pages)
{
ram_addr_t addr;
+ start = rb->offset + start;
unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS);
uint64_t num_dirty = 0;
diff --git a/migration/ram.c b/migration/ram.c
index fe01e7b..3f3842a 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -646,13 +646,13 @@ static inline bool migration_bitmap_clear_dirty(RAMState
*rs, ram_addr_t addr)
return ret;
}
-static void migration_bitmap_sync_range(RAMState *rs, ram_addr_t start,
- ram_addr_t length)
+static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb,
+ ram_addr_t start, ram_addr_t length)
{
unsigned long *bitmap;
bitmap = atomic_rcu_read(&rs->ram_bitmap)->bmap;
rs->migration_dirty_pages +=
- cpu_physical_memory_sync_dirty_bitmap(bitmap, start, length,
+ cpu_physical_memory_sync_dirty_bitmap(bitmap, rb, start, length,
&rs->num_dirty_pages_period);
}
@@ -699,7 +699,7 @@ static void migration_bitmap_sync(RAMState *rs)
qemu_mutex_lock(&rs->bitmap_mutex);
rcu_read_lock();
QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
- migration_bitmap_sync_range(rs, block->offset, block->used_length);
+ migration_bitmap_sync_range(rs, block, 0, block->used_length);
}
rcu_read_unlock();
qemu_mutex_unlock(&rs->bitmap_mutex);
--
2.9.3
- [Qemu-devel] [PULL 35/65] ram: Remove dirty_bytes_rate, (continued)
- [Qemu-devel] [PULL 35/65] ram: Remove dirty_bytes_rate, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 36/65] ram: Move dirty_pages_rate to RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 37/65] ram: Move postcopy_requests into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 38/65] ram: Add QEMUFile to RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 39/65] ram: Move QEMUFile into RAMState, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 40/65] ram: Remove compression_switch and inline its logic, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 41/65] migration: Remove MigrationState from migration_in_postcopy, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 42/65] ram: We don't need MigrationState parameter anymore, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 43/65] ram: Rename qemu_target_page_bits() to qemu_target_page_size(), Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 44/65] ram: Add page-size to output in 'info migrate', Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 45/65] ram: Pass RAMBlock to bitmap_sync,
Juan Quintela <=
- [Qemu-devel] [PULL 46/65] ram: ram_discard_range() don't use the mis parameter, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 47/65] ram: reorganize last_sent_block, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 48/65] ram: Use page number instead of an address for the bitmap operations, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 49/65] ram: Remember last_page instead of last_offset, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 50/65] ram: Change offset field in PageSearchStatus to page, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 52/65] ram: rename last_ram_offset() last_ram_pages(), Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 54/65] migration: Remove MigrationState parameter from migration_is_idle(), Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 51/65] ram: Use ramblock and page offset instead of absolute offset, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 53/65] ram: Use RAMBitmap type for coherence, Juan Quintela, 2017/04/21
- [Qemu-devel] [PULL 55/65] qdev: qdev_hotplug is really a bool, Juan Quintela, 2017/04/21