Message ID | 20240301022829.3390548-7-hao.xiang@bytedance.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Introduce multifd zero page checking. | expand |
Hao Xiang <hao.xiang@bytedance.com> writes: > This change extends the MigrationStatus interface to track zero pages > and zero bytes counter. > > Signed-off-by: Hao Xiang <hao.xiang@bytedance.com> [...] > diff --git a/qapi/migration.json b/qapi/migration.json > index ca9561fbf1..03b850bab7 100644 > --- a/qapi/migration.json > +++ b/qapi/migration.json > @@ -63,6 +63,10 @@ > # between 0 and @dirty-sync-count * @multifd-channels. (since > # 7.1) > # > +# @zero-pages: number of zero pages (since 9.0) > +# > +# @zero-bytes: number of zero bytes sent (since 9.0) > +# Discussion of v3 has led me to believe: 1. A page is either migrated as a normal page or as a zero page. 2. The following equations hold: @normal-bytes = @normal * @page-size @zero-bytes = @zero-pages * @page-size 3. @zero-pages is the same as @duplicate, with a better name. We intend to drop @duplicate eventually. If this is correct, I'd like you to A. Name it @zero for consistency with @normal. Disregard my advice to name it @zero-pages; two consistent bad names are better than one bad name, one good name, and inconsistency. B. Add @zero and @zero-bytes next to @normal and @normal-bytes. C. Deprecate @duplicate (item 3). Separate patch, please. D. Consider documenting more clearly what normal and zero pages are (item 1), and how @FOO, @FOO-pages and @page-size are related (item 2). Could be done in a followup patch. > # Features: > # > # @deprecated: Member @skipped is always zero since 1.5.3 > @@ -81,7 +85,8 @@ > 'multifd-bytes': 'uint64', 'pages-per-second': 'uint64', > 'precopy-bytes': 'uint64', 'downtime-bytes': 'uint64', > 'postcopy-bytes': 'uint64', > - 'dirty-sync-missed-zero-copy': 'uint64' } } > + 'dirty-sync-missed-zero-copy': 'uint64', > + 'zero-pages': 'int', 'zero-bytes': 'size' } } > [...]
> > On Thu, Feb 29, 2024 at 11:40 PM Markus Armbruster <armbru@redhat.com> wrote: > > > > > Hao Xiang <hao.xiang@bytedance.com> writes: > > > > This change extends the MigrationStatus interface to track zero pages > > > > and zero bytes counter. > > > > Signed-off-by: Hao Xiang <hao.xiang@bytedance.com> > > > > [...] > > > > diff --git a/qapi/migration.json b/qapi/migration.json > > > > index ca9561fbf1..03b850bab7 100644 > > > > --- a/qapi/migration.json > > > > +++ b/qapi/migration.json > > > > @@ -63,6 +63,10 @@ > > > > # between 0 and @dirty-sync-count * @multifd-channels. (since > > > > # 7.1) > > > > # > > > > +# @zero-pages: number of zero pages (since 9.0) > > > > +# > > > > +# @zero-bytes: number of zero bytes sent (since 9.0) > > > > +# > > > > Discussion of v3 has led me to believe: > > > > 1. A page is either migrated as a normal page or as a zero page. > > > > 2. The following equations hold: > > > > @normal-bytes = @normal * @page-size > > > > @zero-bytes = @zero-pages * @page-size > > > > 3. @zero-pages is the same as @duplicate, with a better name. We intend > > > > to drop @duplicate eventually. > > > > If this is correct, I'd like you to > > > > A. Name it @zero for consistency with @normal. Disregard my advice to > > > > name it @zero-pages; two consistent bad names are better than one bad > > > > name, one good name, and inconsistency. > > > > B. Add @zero and @zero-bytes next to @normal and @normal-bytes. > > > > C. Deprecate @duplicate (item 3). Separate patch, please. > > > > D. Consider documenting more clearly what normal and zero pages are > > > > (item 1), and how @FOO, @FOO-pages and @page-size are related (item > > > > 2). Could be done in a followup patch. I will move this out of the current patchset and put them into a seperate patchset. I think I am not totally understanding the exact process of deprecating an interface and hence will need your help to probably go a few more versions. And I read from earlier conversation the soft release for QEMU9.0 is 3/12 so hopefully the rest of this patchset can catch it. > > > > # Features: > > > > # > > > > # @deprecated: Member @skipped is always zero since 1.5.3 > > > > @@ -81,7 +85,8 @@ > > > > 'multifd-bytes': 'uint64', 'pages-per-second': 'uint64', > > > > 'precopy-bytes': 'uint64', 'downtime-bytes': 'uint64', > > > > 'postcopy-bytes': 'uint64', > > > > - 'dirty-sync-missed-zero-copy': 'uint64' } } > > > > + 'dirty-sync-missed-zero-copy': 'uint64', > > > > + 'zero-pages': 'int', 'zero-bytes': 'size' } } > > > > [...] > > >
diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 7e96ae6ffd..a38ad0255d 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -111,6 +111,10 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->ram->normal); monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n", info->ram->normal_bytes >> 10); + monitor_printf(mon, "zero pages: %" PRIu64 " pages\n", + info->ram->zero_pages); + monitor_printf(mon, "zero bytes: %" PRIu64 " kbytes\n", + info->ram->zero_bytes >> 10); monitor_printf(mon, "dirty sync count: %" PRIu64 "\n", info->ram->dirty_sync_count); monitor_printf(mon, "page size: %" PRIu64 " kbytes\n", diff --git a/migration/migration.c b/migration/migration.c index bab68bcbef..fc4e3ef52d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1126,6 +1126,8 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) info->ram->skipped = 0; info->ram->normal = stat64_get(&mig_stats.normal_pages); info->ram->normal_bytes = info->ram->normal * page_size; + info->ram->zero_pages = stat64_get(&mig_stats.zero_pages); + info->ram->zero_bytes = info->ram->zero_pages * page_size; info->ram->mbps = s->mbps; info->ram->dirty_sync_count = stat64_get(&mig_stats.dirty_sync_count); diff --git a/qapi/migration.json b/qapi/migration.json index ca9561fbf1..03b850bab7 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -63,6 +63,10 @@ # between 0 and @dirty-sync-count * @multifd-channels. (since # 7.1) # +# @zero-pages: number of zero pages (since 9.0) +# +# @zero-bytes: number of zero bytes sent (since 9.0) +# # Features: # # @deprecated: Member @skipped is always zero since 1.5.3 @@ -81,7 +85,8 @@ 'multifd-bytes': 'uint64', 'pages-per-second': 'uint64', 'precopy-bytes': 'uint64', 'downtime-bytes': 'uint64', 'postcopy-bytes': 'uint64', - 'dirty-sync-missed-zero-copy': 'uint64' } } + 'dirty-sync-missed-zero-copy': 'uint64', + 'zero-pages': 'int', 'zero-bytes': 'size' } } ## # @XBZRLECacheStats: @@ -332,6 +337,8 @@ # "duplicate":123, # "normal":123, # "normal-bytes":123456, +# "zero-pages":123, +# "zero-bytes":123456, # "dirty-sync-count":15 # } # } @@ -358,6 +365,8 @@ # "duplicate":123, # "normal":123, # "normal-bytes":123456, +# "zero-pages":123, +# "zero-bytes":123456, # "dirty-sync-count":15 # } # } @@ -379,6 +388,8 @@ # "duplicate":123, # "normal":123, # "normal-bytes":123456, +# "zero-pages":123, +# "zero-bytes":123456, # "dirty-sync-count":15 # }, # "disk":{ @@ -405,6 +416,8 @@ # "duplicate":10, # "normal":3333, # "normal-bytes":3412992, +# "zero-pages":3333, +# "zero-bytes":3412992, # "dirty-sync-count":15 # }, # "xbzrle-cache":{ diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py index 608d7270f6..693e07c227 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -92,6 +92,8 @@ def _migrate_progress(self, vm): info["ram"].get("skipped", 0), info["ram"].get("normal", 0), info["ram"].get("normal-bytes", 0), + info["ram"].get("zero-pages", 0); + info["ram"].get("zero-bytes", 0); info["ram"].get("dirty-pages-rate", 0), info["ram"].get("mbps", 0), info["ram"].get("dirty-sync-count", 0)
This change extends the MigrationStatus interface to track zero pages and zero bytes counter. Signed-off-by: Hao Xiang <hao.xiang@bytedance.com> --- migration/migration-hmp-cmds.c | 4 ++++ migration/migration.c | 2 ++ qapi/migration.json | 15 ++++++++++++++- tests/migration/guestperf/engine.py | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-)