All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Andrei Gudkov via <qemu-devel@nongnu.org>
Cc: Andrei Gudkov <gudkov.andrei@huawei.com>,  <quintela@redhat.com>,
	<eblake@redhat.com>,  <berrange@redhat.com>,
	 <zhengchuan@huawei.com>
Subject: Re: [PATCH v2 2/4] migration/calc-dirty-rate: detailed stats in sampling mode
Date: Thu, 11 May 2023 08:14:29 +0200	[thread overview]
Message-ID: <877ctfo0my.fsf@pond.sub.org> (raw)
In-Reply-To: <22436421241c49c9b6d9b9120d166392c40fb991.1682598010.git.gudkov.andrei@huawei.com> (Andrei Gudkov via's message of "Thu, 27 Apr 2023 15:42:58 +0300")

Andrei Gudkov via <qemu-devel@nongnu.org> writes:

> Collect number of dirty pages for progresseively increasing time
> periods starting with 125ms up to number of seconds specified with
> calc-dirty-rate. Report through qmp and hmp: 1) vector of dirty page
> measurements, 2) page size, 3) total number of VM pages, 4) number
> of sampled pages.
>
> Signed-off-by: Andrei Gudkov <gudkov.andrei@huawei.com>

[...]

> diff --git a/qapi/migration.json b/qapi/migration.json
> index 2c35b7b9cf..f818f51e0e 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1805,6 +1805,22 @@
   ##
   # @DirtyRateInfo:
   #
   # Information about current dirty page rate of vm.
   #
   # @dirty-rate: an estimate of the dirty page rate of the VM in units
   #     of MB/s, present only when estimating the rate has completed.
   #
   # @status: status containing dirtyrate query status includes
   #     'unstarted' or 'measuring' or 'measured'

Not this patch's fault, but here goes anyway:

0. "dirtyrate" isn't a word.  Spell it "dirty rate".  Many more
   instances elsewhere.

1. "status containing status"... what has the poor English language done
   to us that we torture it so?

2. "includes 'unstarted' or 'measuring' or 'measured' is confusing and
   entirely redundant with the type.  @status doesn't "include" these,
   these are the possible values, and all of them.

Suggest:

     @status: dirty rate measuring status

I do understand how difficult writing good English is for non-native
speakers.  This is mainly a failure of patch review.

   #
   # @start-time: start time in units of second for calculation
   #
   # @calc-time: time in units of second for sample dirty pages
   #
   # @sample-pages: page count per GB for sample dirty pages the default
   #     value is 512 (since 6.1)
   #
   # @mode: mode containing method of calculate dirtyrate includes
   #     'page-sampling' and 'dirty-ring' (Since 6.2)

Still not this patch's fault:

1. "mode containing method": more torture :)

2. "includes 'page-sampling' and 'dirty-ring'" is confusing.

   When it was added in commit 0e21bf24608, it was confusing and
   redundant like the text for @status above.

   Then commit 826b8bc80cb added value 'dirty-bitmap' without updating
   the member doc here.

Suggest:

     @mode: dirty rate measuring mode

   #
   # @vcpu-dirty-rate: dirtyrate for each vcpu if dirty-ring mode
   #     specified (Since 6.2)
   #
> +# @page-size: page size in bytes (since 8.1)
> +#
> +# @n-total-pages: [page-sampling] total number of VM pages (since 8.1)
> +#
> +# @n-sampled-pages: [page-sampling] number of sampled VM pages (since 8.1)
> +#
> +# @periods: [page-sampling] array of time periods expressed in milliseconds
> +#           for which dirty-sample measurements were collected (since 8.1)
> +#
> +# @n-dirty-pages: [page-sampling] number of pages among all sampled pages
> +#                 that were observed as changed during respective time period.
> +#                 i-th element of this array corresponds to the i-th element
> +#                 of the @periods array, i.e. @n-dirty-pages[i] is the number
> +#                 of dirtied pages during period of @periods[i] milliseconds
> +#                 after the initiation of calc-dirty-rate (since 8.1)
> +#

Changed doc comment conventions landed yesterday (merge commit
568992e3440).  Please format like this:

   # @page-size: page size in bytes (since 8.1)
   #
   # @n-total-pages: [page-sampling] total number of VM pages (since 8.1)
   #
   # @n-sampled-pages: [page-sampling] number of sampled VM pages (since
   #     8.1)
   #
   # @n-zero-pages: [page-sampling] number of observed all-zero pages
   #     among all sampled pages (since 8.1)
   #
   # @periods: [page-sampling] array of time periods expressed in
   #     milliseconds for which dirty-sample measurements were collected
   #     (since 8.1)
   #
   # @n-dirty-pages: [page-sampling] number of pages among all sampled
   #     pages that were observed as changed during respective time
   #     period.  i-th element of this array corresponds to the i-th
   #     element of the @periods array, i.e. @n-dirty-pages[i] is the
   #     number of dirtied pages during period of @periods[i]
   #     milliseconds after the initiation of calc-dirty-rate (since 8.1)

The meaning of "[page-sampling]" is unclear.  What are you trying to
express?

For better or worse, we try to avoid abbreviations in QMP.  The "n-"
prefix is one.  What does it stand for?

It's quite unclear how all these numbers relate to each other.  What's
the difference between @n-sampled-pages and @sample-pages?  I think
we're missing an overview of the dirty rate measurement feature.

>  # Since: 5.2
>  ##
>  { 'struct': 'DirtyRateInfo',
> @@ -1814,7 +1830,13 @@
>             'calc-time': 'int64',
>             'sample-pages': 'uint64',
>             'mode': 'DirtyRateMeasureMode',
> -           '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ] } }
> +           '*vcpu-dirty-rate': [ 'DirtyRateVcpu' ],
> +           'page-size': 'int64',

Shouldn't this be of type 'size'?

> +           '*n-total-pages': 'int64',
> +           '*n-sampled-pages': 'int64',
> +           '*periods': ['int64'],
> +           '*n-dirty-pages': ['int64'] } }

'uint64', like @sample-pages?

> +
>  
>  ##
>  # @calc-dirty-rate:



  parent reply	other threads:[~2023-05-11  6:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 12:42 [PATCH v2 0/4] Migration time prediction using calc-dirty-rate Andrei Gudkov via
2023-04-27 12:42 ` [PATCH v2 1/4] migration/calc-dirty-rate: replaced CRC32 with xxHash Andrei Gudkov via
2023-05-10 16:54   ` Juan Quintela
2023-04-27 12:42 ` [PATCH v2 2/4] migration/calc-dirty-rate: detailed stats in sampling mode Andrei Gudkov via
2023-05-10 17:36   ` Juan Quintela
2023-05-12 13:18     ` gudkov.andrei--- via
2023-05-15  8:22       ` Juan Quintela
2023-05-18 14:45         ` gudkov.andrei--- via
2023-05-18 15:13           ` Juan Quintela
2023-05-15  8:23       ` Juan Quintela
2023-05-11  6:14   ` Markus Armbruster [this message]
2023-05-12 14:24     ` gudkov.andrei--- via
2023-05-30  3:06   ` Wang, Lei
2023-04-27 12:42 ` [PATCH v2 3/4] migration/calc-dirty-rate: added n-zero-pages metric Andrei Gudkov via
2023-05-10 17:57   ` Juan Quintela
2023-04-27 12:43 ` [PATCH v2 4/4] migration/calc-dirty-rate: tool to predict migration time Andrei Gudkov via
2023-05-10 18:01   ` Juan Quintela
2023-05-30  3:21   ` Wang, Lei
2023-06-02 13:06     ` gudkov.andrei--- via
2023-05-30 15:46 ` [PATCH v2 0/4] Migration time prediction using calc-dirty-rate Peter Xu
2023-05-31 14:46   ` gudkov.andrei--- via
2023-05-31 15:03     ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ctfo0my.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=gudkov.andrei@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=zhengchuan@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.