[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 2/2] migration/dirtyrate: implement dirty-bitmap dirtyrate
Re: [PATCH v6 2/2] migration/dirtyrate: implement dirty-bitmap dirtyrate calculation
Sat, 17 Jul 2021 10:57:50 +0800
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0
在 2021/7/17 3:36, Peter Xu 写道:
yes, latest version dropped this because dirtyrate_global_dirty_log_stop
below already do the sync before stop dirty log, which is recommended in
patchset of "support dirtyrate at the granualrity of vcpu" and make
dirtyrate more accurate. the older version do not consider this. :)
On Fri, Jul 16, 2021 at 07:13:47PM +0800, firstname.lastname@example.org wrote:
+static void calculate_dirtyrate_dirty_bitmap(struct DirtyRateConfig config)
+ int64_t msec = 0;
+ int64_t start_time;
+ DirtyPageRecord dirty_pages;
+ * 1'round of log sync may return all 1 bits with
+ * KVM_DIRTY_LOG_INITIALLY_SET enable
+ * skip it unconditionally and start dirty tracking
+ * from 2'round of log sync
+ * reset page protect manually and unconditionally.
+ * this make sure kvm dirty log be cleared if
+ * KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE cap is enabled.
+ record_dirtypages_bitmap(&dirty_pages, true);
+ start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+ DirtyStat.start_time = start_time / 1000;
+ msec = config.sample_period_seconds * 1000;
+ msec = set_sample_page_period(msec, start_time);
+ DirtyStat.calc_time = msec / 1000;
+ /* fetch dirty bitmap from kvm and stop dirty tracking */
I don't think it really fetched anything.. So I think we need:
It seems to be there in older versions but not in the latest two versions.
Please still remember to smoke the patches before posting, because without the
log sync we'll read nothing.
+ record_dirtypages_bitmap(&dirty_pages, false);
I think it's easier we take bql at / and release at /, rather than
taking it for every function. Then we can move the bql operations out of
dirtyrate_global_dirty_log_stop() in this patch.
yeah, take bql at  and release at  is reasonable.
but if we try to take bql at , it will sleep for calculation time in
set_sample_page_period which is configured by user, which may be a heavy
how about we take bql at  and release at , ingore bql at /
and let it be the same as older versoin. since we only copy
total_dirty_pages to local var in "get_dirtyrate" thread and maybe we
don't need bql.