From: Hyman Huang(黄勇) <huang...@chinatelecom.cn> since dirty ring has been introduced, there are two methods to track dirty pages of vm. it seems that "logging" has a hint on the method, so rename the global_dirty_log to global_dirty_tracking would make description more accurate.
Signed-off-by: Hyman Huang(黄勇) <huang...@chinatelecom.cn> --- include/exec/memory.h | 2 +- include/exec/ram_addr.h | 4 ++-- softmmu/memory.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index b114f54..cc0e549 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -55,7 +55,7 @@ static inline void fuzz_dma_read_cb(size_t addr, } #endif -extern bool global_dirty_log; +extern bool global_dirty_tracking; typedef struct MemoryRegionOps MemoryRegionOps; diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 3cb9791..a0bce11 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -372,7 +372,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, qatomic_or(&blocks[DIRTY_MEMORY_VGA][idx][offset], temp); - if (global_dirty_log) { + if (global_dirty_tracking) { qatomic_or( &blocks[DIRTY_MEMORY_MIGRATION][idx][offset], temp); @@ -395,7 +395,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, } else { uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE; - if (!global_dirty_log) { + if (!global_dirty_tracking) { clients &= ~(1 << DIRTY_MEMORY_MIGRATION); } diff --git a/softmmu/memory.c b/softmmu/memory.c index c19b0be..5682053 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -39,7 +39,7 @@ static unsigned memory_region_transaction_depth; static bool memory_region_update_pending; static bool ioeventfd_update_pending; -bool global_dirty_log; +bool global_dirty_tracking; static QTAILQ_HEAD(, MemoryListener) memory_listeners = QTAILQ_HEAD_INITIALIZER(memory_listeners); @@ -1813,7 +1813,7 @@ uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr) uint8_t mask = mr->dirty_log_mask; RAMBlock *rb = mr->ram_block; - if (global_dirty_log && ((rb && qemu_ram_is_migratable(rb)) || + if (global_dirty_tracking && ((rb && qemu_ram_is_migratable(rb)) || memory_region_is_iommu(mr))) { mask |= (1 << DIRTY_MEMORY_MIGRATION); } @@ -2666,7 +2666,7 @@ void memory_global_dirty_log_start(void) vmstate_change = NULL; } - global_dirty_log = true; + global_dirty_tracking = true; MEMORY_LISTENER_CALL_GLOBAL(log_global_start, Forward); @@ -2678,7 +2678,7 @@ void memory_global_dirty_log_start(void) static void memory_global_dirty_log_do_stop(void) { - global_dirty_log = false; + global_dirty_tracking = false; /* Refresh DIRTY_MEMORY_MIGRATION bit. */ memory_region_transaction_begin(); @@ -2724,7 +2724,7 @@ static void listener_add_address_space(MemoryListener *listener, if (listener->begin) { listener->begin(listener); } - if (global_dirty_log) { + if (global_dirty_tracking) { if (listener->log_global_start) { listener->log_global_start(listener); } -- 1.8.3.1