On Sun, Jun 27, 2021 at 01:38:14PM +0800, huang...@chinatelecom.cn wrote: > @@ -370,9 +374,17 @@ static inline void > cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, > qatomic_or(&blocks[DIRTY_MEMORY_VGA][idx][offset], temp); > > if (global_dirty_tracking) { > - qatomic_or( > + if (global_dirty_tracking & GLOBAL_DIRTY_MIGRATION) { > + qatomic_or( > &blocks[DIRTY_MEMORY_MIGRATION][idx][offset], > temp); > + } > + > + if (global_dirty_tracking & GLOBAL_DIRTY_DIRTY_RATE) > { > + qatomic_or( > + > &blocks[DIRTY_MEMORY_DIRTY_RATE][idx][offset], > + temp);
So what I meant in the other thread is instead of operating on this bitmap we just record the number of total dirty pages, just like we used to do with rings. PS. IIUC maybe this can even work for dirty rings.. because either dirty ring or dirty logging collect dirty bits into the slot bitmap, then it's further aggregated here from the slot bitmaps. However merging them won't help much because dirty ring can provide finer-granule per-vcpu dirty info, which can be further used for per-vcpu throttling in the future. So just raise this up. > + } > } -- Peter Xu