Skip to contentSkip to conversation

migration: craft the doc comments

PATCH In review ~hyman 3 participants 7 messages Jul 26, 2023 – Aug 2, 2023

lore
Share & tools
lore

~hyman

author
#0 lore raw

cover migration: craft the doc comments

Hi, Markus,

This patchset aims to reformat migration doc comments as commit a937b6aa739. Meanwhile, add myself to the dirty-limit feature maintainer list.

Please review, Thanks.

Yong

Hyman Huang(黄勇) (2):
qapi: Reformat and craft the migration doc comments
MAINTAINERS: Add Hyman Huang to dirty-limit feature

 MAINTAINERS         |  6 +++++
 qapi/migration.json | 66 +++++++++++++++++++++------------------------
 2 files changed, 37 insertions(+), 35 deletions(-)
Signature · 1 line
2.38.5
author
#1 lore raw

PATCH 1/2 qapi: Reformat and craft the migration doc comments

From: Hyman Huang(黄勇) <[email protected]>

Reformat migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions).

Also, craft the dirty-limit capability comment.

---
 qapi/migration.json | 66 +++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 35 deletions(-)
qapi/migration.json +31 -35
index 6b49593d2f..5d5649c885 100644
@@ -258,17 +258,17 @@
 #     blocked.  Present and non-empty when migration is blocked.
 #     (since 6.0)
 #
-# @dirty-limit-throttle-time-per-round: Maximum throttle time (in microseconds) of virtual
-#                                       CPUs each dirty ring full round, which shows how
-#                                       MigrationCapability dirty-limit affects the guest
-#                                       during live migration. (since 8.1)
-#
-# @dirty-limit-ring-full-time: Estimated average dirty ring full time (in microseconds)
-#                              each dirty ring full round, note that the value equals
-#                              dirty ring memory size divided by average dirty page rate
-#                              of virtual CPU, which can be used to observe the average
-#                              memory load of virtual CPU indirectly. Note that zero
-#                              means guest doesn't dirty memory (since 8.1)
+# @dirty-limit-throttle-time-per-round: Maximum throttle time
+#     (in microseconds) of virtual CPUs each dirty ring full round,
+#     which shows how MigrationCapability dirty-limit affects the
+#     guest during live migration.  (Since 8.1)
+#
+# @dirty-limit-ring-full-time: Estimated average dirty ring full
+#     time (in microseconds) each dirty ring full round. The value
+#     equals dirty ring memory size divided by average dirty page
+#     rate of the virtual CPU, which can be used to observe the
+#     average memory load of the virtual CPU indirectly. Note that
+#     zero means guest doesn't dirty memory.  (Since 8.1)
 #
 # Since: 0.14
 ##
@@ -519,15 +519,11 @@
 #     are present.  'return-path' capability must be enabled to use
 #     it.  (since 8.1)
 #
-# @dirty-limit: If enabled, migration will use the dirty-limit algo to
-#               throttle down guest instead of auto-converge algo.
-#               Throttle algo only works when vCPU's dirtyrate greater
-#               than 'vcpu-dirty-limit', read processes in guest os
-#               aren't penalized any more, so this algo can improve
-#               performance of vCPU during live migration. This is an
-#               optional performance feature and should not affect the
-#               correctness of the existing auto-converge algo.
-#               (since 8.1)
+# @dirty-limit: If enabled, migration will throttle vCPUs as needed to
+#     keep their dirty page rate within @vcpu-dirty-limit.  This can
+#     improve responsiveness of large guests during live migration,
+#     and can result in more stable read performance.  Requires KVM
+#     with accelerator property "dirty-ring-size" set.  (Since 8.1)
 #
 # Features:
 #
@@ -822,17 +818,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
-#                             live migration. Should be in the range 1 to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during  live migration. Should be in the range 1 to 1000ms,
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # Since: 2.4
 ##
@@ -988,17 +984,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
-#                             live migration. Should be in the range 1 to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during live migration. Should be in the range 1 to 1000ms,
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # TODO: either fuse back into MigrationParameters, or make
 #     MigrationParameters members mandatory
@@ -1191,17 +1187,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
-#                             live migration. Should be in the range 1 to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during live migration. Should be in the range 1 to 1000ms,
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # Since: 2.4
 ##
Signature · 1 line
2.38.5
#2 lore raw

Re: [PATCH QEMU 1/2] qapi: Reformat and craft the migration doc comments

Quoted 7 lines · ~hyman

From: Hyman Huang(黄勇) <[email protected]>

Reformat migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions).

Also, craft the dirty-limit capability comment.

Split into two patches?

Quoted 17 lines
---
 qapi/migration.json | 66 +++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 35 deletions(-)
qapi/migration.json +0 -4
index 6b49593d2f..5d5649c885 100644
@@ -258,17 +258,17 @@
 #     blocked.  Present and non-empty when migration is blocked.
 #     (since 6.0)
 #
-# @dirty-limit-throttle-time-per-round: Maximum throttle time (in microseconds) of virtual
-#                                       CPUs each dirty ring full round, which shows how
-#                                       MigrationCapability dirty-limit affects the guest
-#                                       during live migration. (since 8.1)

qapi/migration.json line 263

Quoted 10 lines
qapi/migration.json +3 -7
-#
-# @dirty-limit-ring-full-time: Estimated average dirty ring full time (in microseconds)
-#                              each dirty ring full round, note that the value equals
-#                              dirty ring memory size divided by average dirty page rate
-#                              of virtual CPU, which can be used to observe the average
-#                              memory load of virtual CPU indirectly. Note that zero
-#                              means guest doesn't dirty memory (since 8.1)
+# @dirty-limit-throttle-time-per-round: Maximum throttle time
+#     (in microseconds) of virtual CPUs each dirty ring full round,
+#     which shows how MigrationCapability dirty-limit affects the

Perhaps "for each ... round"?

Remind me, what's a "dirty ring full round"?

qapi/migration.json line 267

Quoted 4 lines
qapi/migration.json +4 -0
+#     guest during live migration.  (Since 8.1)
+#
+# @dirty-limit-ring-full-time: Estimated average dirty ring full
+#     time (in microseconds) each dirty ring full round. The value

Likewise.

qapi/migration.json line 268

Quoted 1 line
qapi/migration.json +1 -0
+#     equals dirty ring memory size divided by average dirty page

"the dirty ring memory size divided by the average ..."

qapi/migration.json line 271

Quoted 3 lines
qapi/migration.json +3 -0
+#     rate of the virtual CPU, which can be used to observe the
+#     average memory load of the virtual CPU indirectly. Note that
+#     zero means guest doesn't dirty memory.  (Since 8.1)

Two spaces between sentences for consistency.

Quoted 25 lines
qapi/migration.json +5 -9
 #
 # Since: 0.14
 ##
@@ -519,15 +519,11 @@
 #     are present.  'return-path' capability must be enabled to use
 #     it.  (since 8.1)
 #
-# @dirty-limit: If enabled, migration will use the dirty-limit algo to
-#               throttle down guest instead of auto-converge algo.
-#               Throttle algo only works when vCPU's dirtyrate greater
-#               than 'vcpu-dirty-limit', read processes in guest os
-#               aren't penalized any more, so this algo can improve
-#               performance of vCPU during live migration. This is an
-#               optional performance feature and should not affect the
-#               correctness of the existing auto-converge algo.
-#               (since 8.1)
+# @dirty-limit: If enabled, migration will throttle vCPUs as needed to
+#     keep their dirty page rate within @vcpu-dirty-limit.  This can
+#     improve responsiveness of large guests during live migration,
+#     and can result in more stable read performance.  Requires KVM
+#     with accelerator property "dirty-ring-size" set.  (Since 8.1)
 #
 # Features:
 #

qapi/migration.json line 822

Quoted 8 lines
qapi/migration.json +2 -3
@@ -822,17 +818,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
-#                             live migration. Should be in the range 1 to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during  live migration. Should be in the range 1 to 1000ms,

Single space in "during live", and two space between sentences, please.

qapi/migration.json line 823

Quoted 1 line
qapi/migration.json +1 -0
+#     defaults to 1000ms.  (Since 8.1)

I dislike that we mix milli- and microseconds. Too late to fix, I'm afraid.

Remind me, what't the "periodic time of dirty limit during live migration"?

Quoted 14 lines
qapi/migration.json +2 -2
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # Since: 2.4
 ##

qapi/migration.json line 988

Quoted 8 lines
qapi/migration.json +2 -3
@@ -988,17 +984,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
-#                             live migration. Should be in the range 1 to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during live migration. Should be in the range 1 to 1000ms,

Two spaces between sentences.

Quoted 15 lines
qapi/migration.json +3 -2
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # TODO: either fuse back into MigrationParameters, or make
 #     MigrationParameters members mandatory

qapi/migration.json line 1191

Quoted 8 lines
qapi/migration.json +2 -3
@@ -1191,17 +1187,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty limit during
-#                             live migration. Should be in the range 1 to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during live migration. Should be in the range 1 to 1000ms,

Two spaces between sentences.

Quoted 14 lines
qapi/migration.json +3 -2
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # Since: 2.4
 ##
#3 lore raw

Re: [PATCH QEMU 1/2] qapi: Reformat and craft the migration doc comments

Quoted 4 lines · Markus Armbruster
Quoted 2 lines · ~hyman

From: Hyman Huang(黄勇) <[email protected]>

Quoted 8 lines
Quoted 5 lines

Reformat migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions).

Also, craft the dirty-limit capability comment.

Split into two patches?

Ok.

Quoted 34 lines
Quoted 11 lines
---
 qapi/migration.json | 66 +++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 35 deletions(-)
qapi/migration.json +0 -0
index 6b49593d2f..5d5649c885 100644

qapi/migration.json line 261

Quoted 4 lines
qapi/migration.json +0 -1
@@ -258,17 +258,17 @@
 #     blocked.  Present and non-empty when migration is blocked.
 #     (since 6.0)
 #
-# @dirty-limit-throttle-time-per-round: Maximum throttle time (in

microseconds) of virtual

qapi/migration.json line 262

Quoted 1 line
qapi/migration.json +0 -1
-#                                       CPUs each dirty ring full

round, which shows how

qapi/migration.json line 263

Quoted 1 line
qapi/migration.json +0 -1
-#                                       MigrationCapability dirty-limit

affects the guest

qapi/migration.json line 264

Quoted 1 line
qapi/migration.json +0 -1
-#                                       during live migration. (since

8.1)

qapi/migration.json line 266

Quoted 2 lines
qapi/migration.json +0 -2
-#
-# @dirty-limit-ring-full-time: Estimated average dirty ring full time

(in microseconds)

qapi/migration.json line 267

Quoted 1 line
qapi/migration.json +0 -1
-#                              each dirty ring full round, note that

the value equals

qapi/migration.json line 268

Quoted 1 line
qapi/migration.json +0 -1
-#                              dirty ring memory size divided by

average dirty page rate

qapi/migration.json line 269

Quoted 1 line
qapi/migration.json +0 -1
-#                              of virtual CPU, which can be used to

observe the average

qapi/migration.json line 270

Quoted 1 line
qapi/migration.json +0 -1
-#                              memory load of virtual CPU indirectly.

Note that zero

qapi/migration.json line 271

Quoted 1 line
qapi/migration.json +0 -1
-#                              means guest doesn't dirty memory (since
Quoted 9 lines

8.1)

qapi/migration.json line 263

Quoted 3 lines
qapi/migration.json +3 -0
+# @dirty-limit-throttle-time-per-round: Maximum throttle time
+#     (in microseconds) of virtual CPUs each dirty ring full round,
+#     which shows how MigrationCapability dirty-limit affects the

Perhaps "for each ... round"?

Remind me, what's a "dirty ring full round"?

Every time the x86 PML buffer is filled with gpa, hardware throws an exception and
guest exits to kvm, then to qemu. Qemu will handle the exception with reaping the
dirty ring and get the dirty page info, then enter the kvm, empty the PML buffer and
enter guests again, i call this "dirty ring full round", but it seems not straightforward,
please help me describe that, thanks.

Quoted 55 lines

qapi/migration.json line 267

Quoted 4 lines
qapi/migration.json +4 -0
+#     guest during live migration.  (Since 8.1)
+#
+# @dirty-limit-ring-full-time: Estimated average dirty ring full
+#     time (in microseconds) each dirty ring full round. The value

Likewise.

qapi/migration.json line 268

Quoted 1 line
qapi/migration.json +1 -0
+#     equals dirty ring memory size divided by average dirty page

"the dirty ring memory size divided by the average ..."

qapi/migration.json line 271

Quoted 3 lines
qapi/migration.json +3 -0
+#     rate of the virtual CPU, which can be used to observe the
+#     average memory load of the virtual CPU indirectly. Note that
+#     zero means guest doesn't dirty memory.  (Since 8.1)

Two spaces between sentences for consistency.

Quoted 25 lines
qapi/migration.json +5 -9
 #
 # Since: 0.14
 ##
@@ -519,15 +519,11 @@
 #     are present.  'return-path' capability must be enabled to use
 #     it.  (since 8.1)
 #
-# @dirty-limit: If enabled, migration will use the dirty-limit algo to
-#               throttle down guest instead of auto-converge algo.
-#               Throttle algo only works when vCPU's dirtyrate greater
-#               than 'vcpu-dirty-limit', read processes in guest os
-#               aren't penalized any more, so this algo can improve
-#               performance of vCPU during live migration. This is an
-#               optional performance feature and should not affect the
-#               correctness of the existing auto-converge algo.
-#               (since 8.1)
+# @dirty-limit: If enabled, migration will throttle vCPUs as needed to
+#     keep their dirty page rate within @vcpu-dirty-limit.  This can
+#     improve responsiveness of large guests during live migration,
+#     and can result in more stable read performance.  Requires KVM
+#     with accelerator property "dirty-ring-size" set.  (Since 8.1)
 #
 # Features:
 #

qapi/migration.json line 825

Quoted 4 lines
qapi/migration.json +0 -1
@@ -822,17 +818,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty

limit during

qapi/migration.json line 826

Quoted 1 line
qapi/migration.json +0 -1
-#                             live migration. Should be in the range 1

to 1000ms,

qapi/migration.json line 822

Quoted 3 lines
qapi/migration.json +2 -1
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during  live migration. Should be in the range 1 to 1000ms,

Single space in "during live", and two space between sentences, please.

Quoted 8 lines

qapi/migration.json line 823

Quoted 1 line
qapi/migration.json +1 -0
+#     defaults to 1000ms.  (Since 8.1)

I dislike that we mix milli- and microseconds. Too late to fix, I'm afraid.

Remind me, what't the "periodic time of dirty limit during live migration"?

It is the period to calculate the dirty page rate for each vCPU. So Qemu will use it to compare with the dirty-limit value. If the period is too short, cpu overhead is increasing and if it is too long, the result may not be precise. So we make it configurable.

Quoted 72 lines
Quoted 15 lines
qapi/migration.json +2 -2
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # Since: 2.4
 ##

qapi/migration.json line 991

Quoted 4 lines
qapi/migration.json +0 -1
@@ -988,17 +984,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty

limit during

qapi/migration.json line 992

Quoted 1 line
qapi/migration.json +0 -1
-#                             live migration. Should be in the range 1

to 1000ms,

qapi/migration.json line 822

Quoted 3 lines
qapi/migration.json +2 -1
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during live migration. Should be in the range 1 to 1000ms,

Two spaces between sentences.

Quoted 15 lines
qapi/migration.json +3 -2
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # TODO: either fuse back into MigrationParameters, or make
 #     MigrationParameters members mandatory

qapi/migration.json line 1194

Quoted 4 lines
qapi/migration.json +0 -1
@@ -1191,17 +1187,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty

limit during

qapi/migration.json line 1195

Quoted 1 line
qapi/migration.json +0 -1
-#                             live migration. Should be in the range 1

to 1000ms,

qapi/migration.json line 822

Quoted 3 lines
qapi/migration.json +2 -1
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during live migration. Should be in the range 1 to 1000ms,

Two spaces between sentences.

Quoted 14 lines
qapi/migration.json +3 -2
+#     defaults to 1000ms.  (Since 8.1)
 #
 # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
-#                    Defaults to 1. (Since 8.1)
+#     Defaults to 1.  (Since 8.1)
 #
 # Features:
 #
 # @unstable: Members @x-checkpoint-delay and @x-vcpu-dirty-limit-period
-#            are experimental.
+#     are experimental.
 #
 # Since: 2.4
 ##
Signature · 1 line
Best regards
#4 lore raw

Re: [PATCH QEMU 1/2] qapi: Reformat and craft the migration doc comments

Quoted 49 lines · Yong Huang
Quoted 4 lines · Markus Armbruster
Quoted 2 lines · ~hyman

From: Hyman Huang(黄勇) <[email protected]>

Quoted 8 lines
Quoted 5 lines

Reformat migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions).

Also, craft the dirty-limit capability comment.

Split into two patches?

Ok.

Quoted 31 lines
Quoted 18 lines
---
 qapi/migration.json | 66 +++++++++++++++++++++------------------------
 1 file changed, 31 insertions(+), 35 deletions(-)
qapi/migration.json +0 -4
index 6b49593d2f..5d5649c885 100644
@@ -258,17 +258,17 @@
 #     blocked.  Present and non-empty when migration is blocked.
 #     (since 6.0)
 #
-# @dirty-limit-throttle-time-per-round: Maximum throttle time (inmicroseconds) of virtual
-#                                       CPUs each dirty ring fullround, which shows how
-#                                       MigrationCapability dirty-limitaffects the guest
-#                                       during live migration. (since8.1)

qapi/migration.json line 263

Quoted 10 lines
qapi/migration.json +3 -7
-#
-# @dirty-limit-ring-full-time: Estimated average dirty ring full time(in microseconds)
-#                              each dirty ring full round, note thatthe value equals
-#                              dirty ring memory size divided byaverage dirty page rate
-#                              of virtual CPU, which can be used toobserve the average
-#                              memory load of virtual CPU indirectly.Note that zero
-#                              means guest doesn't dirty memory (since8.1)
+# @dirty-limit-throttle-time-per-round: Maximum throttle time
+#     (in microseconds) of virtual CPUs each dirty ring full round,
+#     which shows how MigrationCapability dirty-limit affects the

Perhaps "for each ... round"?

Quoted 2 lines

Remind me, what's a "dirty ring full round"?

Quoted 9 lines

Every time the x86 PML buffer is filled with gpa, hardware throws an exception and
guest exits to kvm, then to qemu. Qemu will handle the exception with reaping the
dirty ring and get the dirty page info, then enter the kvm, empty the PML buffer and
enter guests again, i call this "dirty ring full round", but it seems not straightforward,
please help me describe that, thanks.

"x86 PML" is page modification logging, right?

Quoted 58 lines
Quoted 58 lines

qapi/migration.json line 267

Quoted 4 lines
qapi/migration.json +4 -0
+#     guest during live migration.  (Since 8.1)
+#
+# @dirty-limit-ring-full-time: Estimated average dirty ring full
+#     time (in microseconds) each dirty ring full round. The value

Likewise.

qapi/migration.json line 268

Quoted 1 line
qapi/migration.json +1 -0
+#     equals dirty ring memory size divided by average dirty page

"the dirty ring memory size divided by the average ..."

qapi/migration.json line 271

Quoted 3 lines
qapi/migration.json +3 -0
+#     rate of the virtual CPU, which can be used to observe the
+#     average memory load of the virtual CPU indirectly. Note that
+#     zero means guest doesn't dirty memory.  (Since 8.1)

Two spaces between sentences for consistency.

Quoted 25 lines
qapi/migration.json +5 -9
 #
 # Since: 0.14
 ##
@@ -519,15 +519,11 @@
 #     are present.  'return-path' capability must be enabled to use
 #     it.  (since 8.1)
 #
-# @dirty-limit: If enabled, migration will use the dirty-limit algo to
-#               throttle down guest instead of auto-converge algo.
-#               Throttle algo only works when vCPU's dirtyrate greater
-#               than 'vcpu-dirty-limit', read processes in guest os
-#               aren't penalized any more, so this algo can improve
-#               performance of vCPU during live migration. This is an
-#               optional performance feature and should not affect the
-#               correctness of the existing auto-converge algo.
-#               (since 8.1)
+# @dirty-limit: If enabled, migration will throttle vCPUs as needed to
+#     keep their dirty page rate within @vcpu-dirty-limit.  This can
+#     improve responsiveness of large guests during live migration,
+#     and can result in more stable read performance.  Requires KVM
+#     with accelerator property "dirty-ring-size" set.  (Since 8.1)
 #
 # Features:
 #

qapi/migration.json line 822

Quoted 8 lines
qapi/migration.json +2 -3
@@ -822,17 +818,17 @@
 #     Nodes are mapped to their block device name if there is one, and
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirtylimit during
-#                             live migration. Should be in the range 1to 1000ms,
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of dirty
+#     limit during  live migration. Should be in the range 1 to 1000ms,

Single space in "during live", and two space between sentences, please.

qapi/migration.json line 823

Quoted 1 line
qapi/migration.json +1 -0
+#     defaults to 1000ms.  (Since 8.1)

I dislike that we mix milli- and microseconds. Too late to fix, I'm afraid.

Quoted 8 lines
Quoted 3 lines

Remind me, what't the "periodic time of dirty limit during live migration"?

It is the period to calculate the dirty page rate for each vCPU. So Qemu will use it to compare with the dirty-limit value. If the period is too short, cpu overhead is increasing and if it is too long, the result may not be precise. So we make it configurable.

The limited migration knowledge I have wasn't enough to review the doc part of your QAPI schema patch with reasonable effort and within a reasonable time. You had to answer a lot of fairly basic questions. Thanks for your patience.

Perhaps I should've given up and left the docs to the migration maintainers.

I believe what I've been missing is an overview of the dirty limit algorithm to throttle guests being live-migrated.

Could we have that in docs/devel/migration.rst?

Apropos migration.rst: not a peep on compression. Juan, Peter, Leonardo, should it be covered there?

[...]

#5 lore raw

Re: [PATCH QEMU 1/2] qapi: Reformat and craft the migration doc comments

Quoted 73 lines · Markus Armbruster
Quoted 1 line · Yong Huang

On Fri, Jul 28, 2023 at 3:49 PM Markus Armbruster <[email protected]>

Quoted 9 lines · wrote:
Quoted 9 lines
Quoted 6 lines · ~hyman

From: Hyman Huang(黄勇) <[email protected]>

Reformat migration doc comments to conform to current conventions as commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions).

Quoted 10 lines
Quoted 4 lines
Quoted 1 line

Also, craft the dirty-limit capability comment.

Split into two patches?

Ok.

Quoted 4 lines
Quoted 4 lines
---
 qapi/migration.json | 66

+++++++++++++++++++++------------------------

Quoted 11 lines
Quoted 11 lines

qapi/migration.json line 261

Quoted 11 lines
 1 file changed, 31 insertions(+), 35 deletions(-)
qapi/migration.json +0 -1
index 6b49593d2f..5d5649c885 100644
@@ -258,17 +258,17 @@
 #     blocked.  Present and non-empty when migration is blocked.
 #     (since 6.0)
 #
-# @dirty-limit-throttle-time-per-round: Maximum throttle time

(inmicroseconds) of virtual

Quoted 1 line
Quoted 1 line

qapi/migration.json line 262

Quoted 1 line
qapi/migration.json +0 -1
-#                                       CPUs each dirty ring

fullround, which shows how

Quoted 1 line
Quoted 1 line

qapi/migration.json line 263

Quoted 1 line
qapi/migration.json +0 -1
-#                                       MigrationCapability

dirty-limitaffects the guest

Quoted 1 line
Quoted 1 line

qapi/migration.json line 264

Quoted 1 line
qapi/migration.json +0 -1
-#                                       during live migration.

(since8.1)

Quoted 2 lines
Quoted 2 lines

qapi/migration.json line 266

Quoted 2 lines
qapi/migration.json +0 -2
-#
-# @dirty-limit-ring-full-time: Estimated average dirty ring full

time(in microseconds)

Quoted 1 line
Quoted 1 line

qapi/migration.json line 267

Quoted 1 line
qapi/migration.json +0 -1
-#                              each dirty ring full round, note

thatthe value equals

Quoted 1 line
Quoted 1 line

qapi/migration.json line 268

Quoted 1 line
qapi/migration.json +0 -1
-#                              dirty ring memory size divided

byaverage dirty page rate

Quoted 1 line
Quoted 1 line

qapi/migration.json line 269

Quoted 1 line
qapi/migration.json +0 -1
-#                              of virtual CPU, which can be used

toobserve the average

Quoted 1 line
Quoted 1 line

qapi/migration.json line 270

Quoted 1 line
qapi/migration.json +0 -1
-#                              memory load of virtual CPU

indirectly.Note that zero

Quoted 1 line
Quoted 1 line

qapi/migration.json line 271

Quoted 1 line
qapi/migration.json +0 -1
-#                              means guest doesn't dirty memory

(since8.1)

Quoted 8 lines
Quoted 8 lines

qapi/migration.json line 263

Quoted 3 lines
qapi/migration.json +3 -0
+# @dirty-limit-throttle-time-per-round: Maximum throttle time
+#     (in microseconds) of virtual CPUs each dirty ring full round,
+#     which shows how MigrationCapability dirty-limit affects the

Perhaps "for each ... round"?

Remind me, what's a "dirty ring full round"?

Quoted 9 lines

Every time the x86 PML buffer is filled with gpa, hardware throws an exception and
guest exits to kvm, then to qemu. Qemu will handle the exception with reaping the
dirty ring and get the dirty page info, then enter the kvm, empty the PML buffer and
enter guests again, i call this "dirty ring full round", but it seems not straightforward,
please help me describe that, thanks.

Quoted 2 lines

"x86 PML" is page modification logging, right?

Yes.

The dirty ring full round may be actually imprecise indeed. I'll try to refactor the
comment in the next version, hoping to do better.

Quoted 77 lines
Quoted 18 lines
Quoted 18 lines

qapi/migration.json line 267

Quoted 5 lines
qapi/migration.json +4 -0
+#     guest during live migration.  (Since 8.1)
+#
+# @dirty-limit-ring-full-time: Estimated average dirty ring full
+#     time (in microseconds) each dirty ring full round. The value

Likewise.

qapi/migration.json line 268

Quoted 1 line
qapi/migration.json +1 -0
+#     equals dirty ring memory size divided by average dirty page

"the dirty ring memory size divided by the average ..."

qapi/migration.json line 271

Quoted 3 lines
qapi/migration.json +3 -0
+#     rate of the virtual CPU, which can be used to observe the
+#     average memory load of the virtual CPU indirectly. Note that
+#     zero means guest doesn't dirty memory.  (Since 8.1)

Two spaces between sentences for consistency.

Quoted 8 lines
Quoted 8 lines

qapi/migration.json line 522

Quoted 8 lines
qapi/migration.json +0 -1
 #
 # Since: 0.14
 ##
@@ -519,15 +519,11 @@
 #     are present.  'return-path' capability must be enabled to use
 #     it.  (since 8.1)
 #
-# @dirty-limit: If enabled, migration will use the dirty-limit algo

to

Quoted 2 lines
Quoted 2 lines

qapi/migration.json line 524

Quoted 2 lines
qapi/migration.json +0 -2
-#               throttle down guest instead of auto-converge algo.
-#               Throttle algo only works when vCPU's dirtyrate

greater

Quoted 4 lines
Quoted 4 lines

qapi/migration.json

Quoted 4 lines
qapi/migration.json +0 -4
-#               than 'vcpu-dirty-limit', read processes in guest os
-#               aren't penalized any more, so this algo can improve
-#               performance of vCPU during live migration. This is an
-#               optional performance feature and should not affect

the

Quoted 3 lines
Quoted 3 lines

qapi/migration.json

Quoted 3 lines
qapi/migration.json +1 -2
-#               correctness of the existing auto-converge algo.
-#               (since 8.1)
+# @dirty-limit: If enabled, migration will throttle vCPUs as needed

to

Quoted 9 lines
Quoted 9 lines

qapi/migration.json line 818

Quoted 9 lines
qapi/migration.json +4 -0
+#     keep their dirty page rate within @vcpu-dirty-limit.  This can
+#     improve responsiveness of large guests during live migration,
+#     and can result in more stable read performance.  Requires KVM
+#     with accelerator property "dirty-ring-size" set.  (Since 8.1)
 #
 # Features:
 #
@@ -822,17 +818,17 @@
 #     Nodes are mapped to their block device name if there is one,

and

Quoted 3 lines
Quoted 3 lines

qapi/migration.json

Quoted 3 lines
qapi/migration.json +0 -1
 #     to their node name otherwise.  (Since 5.2)
 #
-# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of

dirtylimit during

Quoted 1 line
Quoted 1 line

qapi/migration.json line 826

Quoted 1 line
qapi/migration.json +0 -1
-#                             live migration. Should be in the range

1to 1000ms,

Quoted 2 lines
Quoted 2 lines

qapi/migration.json line 821

Quoted 2 lines
qapi/migration.json +1 -1
-#                             defaults to 1000ms. (Since 8.1)
+# @x-vcpu-dirty-limit-period: Periodic time (in milliseconds) of

dirty

Quoted 1 line
Quoted 1 line

qapi/migration.json line 822

Quoted 1 line
qapi/migration.json +1 -0
+#     limit during  live migration. Should be in the range 1 to

1000ms,

Quoted 8 lines
Quoted 8 lines

Single space in "during live", and two space between sentences, please.

qapi/migration.json line 823

Quoted 1 line
qapi/migration.json +1 -0
+#     defaults to 1000ms.  (Since 8.1)

I dislike that we mix milli- and microseconds. Too late to fix, I'm afraid.

Quoted 8 lines
Quoted 3 lines

Remind me, what't the "periodic time of dirty limit during live migration"?

It is the period to calculate the dirty page rate for each vCPU. So Qemu will use it to compare with the dirty-limit value. If the period is too short, cpu overhead is increasing and if it is too long, the result may not be precise. So we make it configurable.

Quoted 5 lines

The limited migration knowledge I have wasn't enough to review the doc part of your QAPI schema patch with reasonable effort and within a reasonable time. You had to answer a lot of fairly basic questions. Thanks for your patience.

Not at all, feel free to comment on the patch set. I'll try my best to reply.

Quoted 9 lines

Perhaps I should've given up and left the docs to the migration maintainers.

I believe what I've been missing is an overview of the dirty limit algorithm to throttle guests being live-migrated.

Could we have that in docs/devel/migration.rst?

No problem, I'll do that and request for comments in the next version.

Quoted 7 lines

Apropos migration.rst: not a peep on compression. Juan, Peter, Leonardo, should it be covered there?

[...]

Signature · 1 line
Best regards
author
#6 lore raw

PATCH 2/2 MAINTAINERS: Add Hyman Huang to dirty-limit feature

In reply to ~hyman

From: Hyman Huang(黄勇) <[email protected]>

---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
index 12e59b6b27..d72fd63a8e 100644
@@ -3437,6 +3437,12 @@ F: hw/core/clock-vmstate.c
 F: hw/core/qdev-clock.c
 F: docs/devel/clocks.rst
 
+Dirty-limit feature
+M: Hyman Huang <[email protected]>
+S: Maintained
+F: softmmu/dirtylimit.c
+F: include/sysemu/dirtylimit.h
+
 Usermode Emulation
 ------------------
 Overall usermode emulation
Signature · 1 line
2.38.5