Re: [Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Chao Fan
On Tue, Mar 14, 2017 at 09:41:30AM +0800, Li Zhijian wrote: > > >On 03/14/2017 09:26 AM, Chao Fan wrote: >> In function cpu_physical_memory_sync_dirty_bitmap, file >> include/exec/ram_addr.h: >> >> if (src[idx][offset]) { >> unsigned long bits = atomic_xchg(&src[idx][offset], 0); >> unsign

Re: [Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Li Zhijian
On 03/14/2017 09:26 AM, Chao Fan wrote: In function cpu_physical_memory_sync_dirty_bitmap, file include/exec/ram_addr.h: if (src[idx][offset]) { unsigned long bits = atomic_xchg(&src[idx][offset], 0); unsigned long new_dirty; new_dirty = ~dest[k]; dest[k] |= bits; new_dirty

[Qemu-devel] [PATCH] Change the method to calculate dirty-pages-rate

2017-03-13 Thread Chao Fan
In function cpu_physical_memory_sync_dirty_bitmap, file include/exec/ram_addr.h: if (src[idx][offset]) { unsigned long bits = atomic_xchg(&src[idx][offset], 0); unsigned long new_dirty; new_dirty = ~dest[k]; dest[k] |= bits; new_dirty &= bits; num_dirty += ctpopl(new_dirty)