* [PATCH] migration/dirtyrate: Show sample pages only in page-sampling mode
@ 2022-11-29 4:04 Zhenzhong Duan
2022-11-29 15:23 ` Peter Xu
2023-02-02 15:25 ` Juan Quintela
0 siblings, 2 replies; 3+ messages in thread
From: Zhenzhong Duan @ 2022-11-29 4:04 UTC (permalink / raw)
To: qemu-devel; +Cc: quintela, dgilbert, peterx, zhengchuan, huangy81
The value of "Sample Pages" is confusing in mode other than page-sampling.
See below:
(qemu) calc_dirty_rate -b 10 520
(qemu) info dirty_rate
Status: measuring
Start Time: 11646834 (ms)
Sample Pages: 520 (per GB)
Period: 10 (sec)
Mode: dirty-bitmap
Dirty rate: (not ready)
(qemu) info dirty_rate
Status: measured
Start Time: 11646834 (ms)
Sample Pages: 0 (per GB)
Period: 10 (sec)
Mode: dirty-bitmap
Dirty rate: 2 (MB/s)
While it's totally useless in dirty-ring and dirty-bitmap mode, fix to
show it only in page-sampling mode.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
migration/dirtyrate.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index d6f1e01a7001..5041c2558c62 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -720,8 +720,8 @@ void qmp_calc_dirty_rate(int64_t calc_time,
mode = DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING;
}
- if (has_sample_pages && mode == DIRTY_RATE_MEASURE_MODE_DIRTY_RING) {
- error_setg(errp, "either sample-pages or dirty-ring can be specified.");
+ if (has_sample_pages && mode != DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING) {
+ error_setg(errp, "sample-pages is used only in page-sampling mode");
return;
}
@@ -791,8 +791,10 @@ void hmp_info_dirty_rate(Monitor *mon, const QDict *qdict)
DirtyRateStatus_str(info->status));
monitor_printf(mon, "Start Time: %"PRIi64" (ms)\n",
info->start_time);
- monitor_printf(mon, "Sample Pages: %"PRIu64" (per GB)\n",
- info->sample_pages);
+ if (info->mode == DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING) {
+ monitor_printf(mon, "Sample Pages: %"PRIu64" (per GB)\n",
+ info->sample_pages);
+ }
monitor_printf(mon, "Period: %"PRIi64" (sec)\n",
info->calc_time);
monitor_printf(mon, "Mode: %s\n",
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] migration/dirtyrate: Show sample pages only in page-sampling mode
2022-11-29 4:04 [PATCH] migration/dirtyrate: Show sample pages only in page-sampling mode Zhenzhong Duan
@ 2022-11-29 15:23 ` Peter Xu
2023-02-02 15:25 ` Juan Quintela
1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2022-11-29 15:23 UTC (permalink / raw)
To: Zhenzhong Duan; +Cc: qemu-devel, quintela, dgilbert, zhengchuan, huangy81
On Tue, Nov 29, 2022 at 12:04:04PM +0800, Zhenzhong Duan wrote:
> The value of "Sample Pages" is confusing in mode other than page-sampling.
> See below:
>
> (qemu) calc_dirty_rate -b 10 520
> (qemu) info dirty_rate
> Status: measuring
> Start Time: 11646834 (ms)
> Sample Pages: 520 (per GB)
> Period: 10 (sec)
> Mode: dirty-bitmap
> Dirty rate: (not ready)
>
> (qemu) info dirty_rate
> Status: measured
> Start Time: 11646834 (ms)
> Sample Pages: 0 (per GB)
> Period: 10 (sec)
> Mode: dirty-bitmap
> Dirty rate: 2 (MB/s)
>
> While it's totally useless in dirty-ring and dirty-bitmap mode, fix to
> show it only in page-sampling mode.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] migration/dirtyrate: Show sample pages only in page-sampling mode
2022-11-29 4:04 [PATCH] migration/dirtyrate: Show sample pages only in page-sampling mode Zhenzhong Duan
2022-11-29 15:23 ` Peter Xu
@ 2023-02-02 15:25 ` Juan Quintela
1 sibling, 0 replies; 3+ messages in thread
From: Juan Quintela @ 2023-02-02 15:25 UTC (permalink / raw)
To: Zhenzhong Duan; +Cc: qemu-devel, dgilbert, peterx, zhengchuan, huangy81
Zhenzhong Duan <zhenzhong.duan@intel.com> wrote:
> The value of "Sample Pages" is confusing in mode other than page-sampling.
> See below:
>
> (qemu) calc_dirty_rate -b 10 520
> (qemu) info dirty_rate
> Status: measuring
> Start Time: 11646834 (ms)
> Sample Pages: 520 (per GB)
> Period: 10 (sec)
> Mode: dirty-bitmap
> Dirty rate: (not ready)
>
> (qemu) info dirty_rate
> Status: measured
> Start Time: 11646834 (ms)
> Sample Pages: 0 (per GB)
> Period: 10 (sec)
> Mode: dirty-bitmap
> Dirty rate: 2 (MB/s)
>
> While it's totally useless in dirty-ring and dirty-bitmap mode, fix to
> show it only in page-sampling mode.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
queued.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-02 15:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29 4:04 [PATCH] migration/dirtyrate: Show sample pages only in page-sampling mode Zhenzhong Duan
2022-11-29 15:23 ` Peter Xu
2023-02-02 15:25 ` Juan Quintela
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).