qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Chao Fan
Subject: Re: [Qemu-devel] [PATCH v2] Change the method to calculate dirty-pages-rate
Date: Tue, 14 Mar 2017 17:35:34 +0800
User-agent: Mutt/1.7.1 (2016-10-04)

On Tue, Mar 14, 2017 at 09:38:46AM +0100, Juan Quintela wrote:
>Chao Fan <address@hidden> 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 &= bits;
>>     num_dirty += ctpopl(new_dirty);
>> }
>>
>> After these codes executed, only the pages not dirtied in bitmap(dest),
>> but dirtied in dirty_memory[DIRTY_MEMORY_MIGRATION] will be calculated.
>> For example:
>> When ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION] = 0b00001111,
>> and atomic_rcu_read(&migration_bitmap_rcu)->bmap = 0b00000011,
>> the new_dirty will be 0b00001100, and this function will return 2 but not
>> 4 which is expected.
>> the dirty pages in dirty_memory[DIRTY_MEMORY_MIGRATION] are all new,
>> so these should be calculated also.
>#
>> Signed-off-by: Chao Fan <address@hidden>
>> Signed-off-by: Li Zhijian <address@hidden>
>>
>> ---
>> v2: Remove the parameter 'num_dirty_pages_init'
>>     Fix incoming parameters of trace_migration_bitmap_sync_end
>
>Reviewed-by: Juan Quintela <address@hidden>
Hi Juan,

Thank you for your review!

>
>Just curious, does this change show any difference in any load?
I think this method can show the new dirty pages more precisely than
before, so it's helpful to determine the cpu throttle value.

You can see this mail:
https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg03479.html

And according to Daniel's suggestion, 'inst-dirty-pages-rate' in my
old patch isn't needed anymore after this patch:
https://www.mail-archive.com/address@hidden/msg436183.html

Thanks,
Chao Fan
>
>Later, Juan.
>
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]