[PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw

2022-11-17 Thread huangy81
From: Hyman Huang(黄勇) This patch aims to fix unexpected negotiation features for vhost-user netdev interface. When openvswitch reconnect Qemu after an unexpected disconnection and Qemu therefore start the vhost_dev, acked_features field in vhost_dev is initialized with value fetched from acked_f

[PATCH v4 1/3] vhost-user: Refactor vhost acked features saving

2022-11-17 Thread huangy81
From: Hyman Huang(黄勇) Abstract vhost acked features saving into vhost_user_save_acked_features, export it as util function. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Guoyi Tu --- include/net/vhost-user.h | 1 + net/vhost-user.c | 21 +++-- 2 files changed, 16 inse

[PATCH v4 0/3] Fix the virtio features negotiation flaw

2022-11-17 Thread huangy81
From: Hyman Huang(黄勇) v4: -rebase on master -add stub function to fix build errors -code clean on [PATCH v2 1/2]: drop 'cleanup' parameter in vhost_user_save_acked_features. -code clean on [PATCH v2 2/2]: make refactor of chr_closed_bh a standalone patch. Above changes are suggested by Michael

[PATCH v4 2/3] vhost-user: Refactor the chr_closed_bh

2022-11-17 Thread huangy81
From: Hyman Huang(黄勇) Use vhost_user_save_acked_features to implemente acked features saving. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Guoyi Tu --- net/vhost-user.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index f5cb095.

[PATCH v2 02/11] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit"

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) dirty_rate paraemter of hmp command "set_vcpu_dirty_limit" is invalid if less than 0, so add parameter check for it. Signed-off-by: Hyman Huang(黄勇) --- softmmu/dirtylimit.c | 5 + 1 file changed, 5 insertions(+) diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.

[PATCH v2 00/11] migration: introduce dirtylimit capability

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) v2: This version make a little bit modifications comparing with version 1 as following: 1. fix the overflow issue reported by Peter Maydell 2. add parameter check for hmp "set_vcpu_dirty_limit" command 3. fix the racing issue between dirty ring reaper thread and Qemu mai

[PATCH v2 01/11] dirtylimit: Fix overflow when computing MB

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) overity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pet

[PATCH v2 06/11] migration: Introduce dirty-limit capability

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH v2 11/11] tests/migration: Introduce dirty-limit into guestperf

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Guestperf tool does not cover the dirty-limit migration currently, support this feature. To enable dirty-limit, setting x-vcpu-dirty-limit-period as 500ms and x-vcpu-dirty-limit as 10MB/s: $ ./tests/migration/guestperf.py \ --dirty-limit --x-vcpu-dirty-limit-period 500

[PATCH v2 09/11] tests: Add migration dirty-limit capability test

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and x-vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The

[PATCH v2 04/11] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is in the range of 1 to 1000ms and used to make dirtyrate calculation period configurable. Signed-off-by: Hyman Huang(黄勇) --- migration/migration.c | 26 ++ monitor/hmp-c

[PATCH v2 05/11] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH v2 03/11] kvm-all: Do not allow reap vcpu dirty ring buffer if not ready

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) When tested large vcpu size vm with dirtylimit feature, Qemu crashed due to the assertion in kvm_dirty_ring_reap_one, which assert that vcpu's kvm_dirty_gfns has been allocated and not NULL. Because dirty ring reaper thread races with Qemu main thread, reaper may reap vcpu'

[PATCH v2 10/11] tests/migration: Introduce dirty-ring-size option into guestperf

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Guestperf tool does not enable diry ring feature when test migration by default. To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf tools, which ranges in [1024, 65536]. To set dirty ring size with 4096 during migration test:

[PATCH v2 07/11] migration: Implement dirty-limit convergence algo

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Enable dirty page limit if dirty_rate_high_cnt greater than 2 when dirty-limit capability enabled,

[PATCH v2 08/11] migration: Export dirty-limit time info

2022-11-21 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe the process of dirty limit during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH v3 02/10] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit"

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) dirty_rate paraemter of hmp command "set_vcpu_dirty_limit" is invalid if less than 0, so add parameter check for it. Note that this patch also delete the unsolicited help message and clean up the code. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Markus Armbruster Revie

[PATCH v3 08/10] migration: Implement dirty-limit convergence algo

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Enable dirty page limit if dirty_rate_high_cnt greater than 2 when dirty-limit capability enabled,

[PATCH v3 05/10] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH v3 06/10] migration: Introduce dirty-limit capability

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH v3 04/10] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is in the range of 1 to 1000ms and used to make dirtyrate calculation period configurable. Currently with the "x-vcpu-dirty-limit-period" varies, the total time of live migration changes, test res

[PATCH v3 10/10] tests: Add migration dirty-limit capability test

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The te

[PATCH v3 00/10] migration: introduce dirtylimit capabilit

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) v3: This version make some modifications inspired by Peter and Markus as following: 1. Do the code clean up in [PATCH v2 02/11] suggested by Markus 2. Replace the [PATCH v2 03/11] with a much simpler patch posted by Peter to fix the following bug: https://bugzilla.red

[PATCH v3 01/10] dirtylimit: Fix overflow when computing MB

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

[PATCH v3 09/10] migration: Export dirty-limit time info for observation

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe if dirty limit take effect during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH v3 03/10] kvm: dirty-ring: Fix race with vcpu creation

2022-12-03 Thread huangy81
From: Peter Xu It's possible that we want to reap a dirty ring on a vcpu that is during creation, because the vcpu is put onto list (CPU_FOREACH visible) before initialization of the structures. In this case: qemu_init_vcpu x86_cpu_realizefn cpu_exec_realizefn cpu_list_a

[PATCH v3 07/10] migration: Refactor auto-converge capability logic

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Check if block migration is running before throttling guest down in auto-converge way. Note that this modification is kind of like code clean, because block migration does not depend on auto-converge capability, so the order of checks can be adjusted. Signed-off-by: Hyman

[PATCH RESEND v3 04/10] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is in the range of 1 to 1000ms and used to make dirtyrate calculation period configurable. Currently with the "x-vcpu-dirty-limit-period" varies, the total time of live migration changes, test res

[PATCH RESEND v3 08/10] migration: Implement dirty-limit convergence algo

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Enable dirty page limit if dirty_rate_high_cnt greater than 2 when dirty-limit capability enabled,

[PATCH RESEND v3 05/10] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH RESEND v3 03/10] kvm: dirty-ring: Fix race with vcpu creation

2022-12-03 Thread huangy81
From: Peter Xu It's possible that we want to reap a dirty ring on a vcpu that is during creation, because the vcpu is put onto list (CPU_FOREACH visible) before initialization of the structures. In this case: qemu_init_vcpu x86_cpu_realizefn cpu_exec_realizefn cpu_list_a

[PATCH RESEND v3 07/10] migration: Refactor auto-converge capability logic

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Check if block migration is running before throttling guest down in auto-converge way. Note that this modification is kind of like code clean, because block migration does not depend on auto-converge capability, so the order of checks can be adjusted. Signed-off-by: Hyman

[PATCH RESEND v3 10/10] tests: Add migration dirty-limit capability test

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The te

[PATCH RESEND v3 00/10] migration: introduce dirtylimit capability

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) v3(resend): - fix the syntax error of the topic. v3: This version make some modifications inspired by Peter and Markus as following: 1. Do the code clean up in [PATCH v2 02/11] suggested by Markus 2. Replace the [PATCH v2 03/11] with a much simpler patch posted by Peter

[PATCH RESEND v3 01/10] dirtylimit: Fix overflow when computing MB

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

[PATCH RESEND v3 09/10] migration: Export dirty-limit time info for observation

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe if dirty limit take effect during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH RESEND v3 06/10] migration: Introduce dirty-limit capability

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH RESEND v3 02/10] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit"

2022-12-03 Thread huangy81
From: Hyman Huang(黄勇) dirty_rate paraemter of hmp command "set_vcpu_dirty_limit" is invalid if less than 0, so add parameter check for it. Note that this patch also delete the unsolicited help message and clean up the code. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Markus Armbruster Revie

[PATCH 0/8] migration: introduce dirtylimit capability

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Abstract This series added a new migration capability called "dirtylimit". It can be enabled when dirty ring is enabled, and it'll improve the vCPU performance during the process of migration. It is based on the previous patchset: https://lore.kernel.org/qemu-deve

[PATCH 2/8] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH 7/8] tests/migration: Introduce dirty-ring-size option into guestperf

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Guestperf tool does not enable diry ring feature when test migration by default. To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf tools, which ranges in [1024, 65536]. To set dirty ring size with 4096 during migration test:

[PATCH 4/8] migration: Implement dirty-limit convergence algo

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Signed-off-by: Hyman Huang(黄勇) --- migration/ram.c| 53 +

[PATCH 1/8] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is used to make dirtyrate calculation period configurable. Signed-off-by: Hyman Huang(黄勇) --- migration/migration.c | 16 monitor/hmp-cmds.c| 8 qapi/migration.jso

[PATCH 3/8] migration: Introduce dirty-limit capability

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH 5/8] migration: Export dirty-limit time info

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe the process of dirty limit during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH 6/8] tests: Add migration dirty-limit capability test

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The te

[PATCH 8/8] tests/migration: Introduce dirty-limit into guestperf

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Guestperf tool does not cover the dirty-limit migration currently, support this feature. To enable dirty-limit, setting x-vcpu-dirty-limit-period as 500ms and vcpu-dirty-limit as 10MB/s: $ ./tests/migration/guestperf.py \ --dirty-limit --x-vcpu-dirty-limit-period 500 \

[PATCH] dirtylimit: Fix overflow when computing MB

2022-07-29 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

[PATCH v1] dirtylimit: Fix overflow when computing MB

2022-07-29 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

[PATCH v1 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-17 Thread huangy81
From: Hyman Huang(黄勇) introduce the third method GLOBAL_DIRTY_RESTRAINT of dirty tracking for calculate dirtyrate periodly for dirty restraint. implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. add dirtyrestraint.h to introduce the util function for dirt

[PATCH v1 2/3] cpu-throttle: implement vCPU throttle

2021-11-17 Thread huangy81
From: Hyman Huang(黄勇) implement dirty restraint by kicking each vcpu as the auto-converge does during migration, but just kick the specified vcpu instead, not all the vcpu of vm. start a thread to track the dirty restraint status and adjuct the throttle pencentage dynamically depend on current a

[PATCH v1 0/3] support dirty restraint on vCPU

2021-11-17 Thread huangy81
From: Hyman Huang(黄勇) this patchset introduce a mechanism to impose dirty restraint on vCPU, aiming to keep the vCPU running in a certain dirtyrate given by user. dirty restraint on vCPU maybe an alternative method to implement convergence logic for live migration, which could improve guest memor

[PATCH v1 3/3] cpus-common: implement dirty restraint on vCPU

2021-11-17 Thread huangy81
From: Hyman Huang(黄勇) implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. introduce qmp commands dirty-restraint/dirty-restraint-cancel to impose/cancel dirty restraint on vCPU Signed-off-by: Hyman Huang(黄勇) ---

[PATCH v2 3/3] cpus-common: implement dirty limit on vCPU

2021-11-18 Thread huangy81
From: Hyman Huang(黄勇) implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty limit on vCPU. Signed-off-by: Hyman Huang(黄勇) --- cpus-com

[PATCH v2 2/3] cpu-throttle: implement vCPU throttle

2021-11-18 Thread huangy81
From: Hyman Huang(黄勇) impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current a

[PATCH v2 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-18 Thread huangy81
From: Hyman Huang(黄勇) introduce the third method GLOBAL_DIRTY_RESTRAINT of dirty tracking for calculate dirtyrate periodly for dirty restraint. implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. add dirtylimit.h to introduce the util function for dirty li

[PATCH v2 0/3] support dirty restraint on vCPU

2021-11-18 Thread huangy81
From: Hyman Huang(黄勇) v2: - rebase on master - modify the following points according to the advices given by Juan 1. rename dirtyrestraint to dirtylimit 2. implement the full lifecyle function of dirtylimit_calc, include dirtylimit_calc and dirtylimit_calc_quit 3. introduce 'quit' fiel

[PATCH v3 0/3] support dirty restraint on vCPU

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) v3: - rebase on master - modify the following points according to the advice given by Markus 1. remove the DirtyRateQuotaVcpu and use its field as option directly 2. add comments to show details of what dirtylimit setup do 3. explain how to use dirtylimit in combinatio

[PATCH v3 3/3] cpus-common: implement dirty limit on vCPU

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty limit on vCPU. Signed-off-by: Hyman Huang(黄勇) --- cpus-com

[PATCH v3 2/3] cpu-throttle: implement vCPU throttle

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current a

[PATCH v3 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-20 Thread huangy81
From: Hyman Huang(黄勇) introduce the third method GLOBAL_DIRTY_RESTRAINT of dirty tracking for calculate dirtyrate periodly for dirty restraint. implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. add dirtylimit.h to introduce the util function for dirty li

[PATCH v4 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-22 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty restraint. Implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. Add dirtylimit.h to introduce the util function for dirty limit

[PATCH v4 2/3] cpu-throttle: implement vCPU throttle

2021-11-22 Thread huangy81
From: Hyman Huang(黄勇) Impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. Start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current a

[PATCH v4 3/3] cpus-common: implement dirty limit on vCPU

2021-11-22 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty limit on vCPU. Signed-off-by: Hyman Huang(黄勇) --- cpus-com

[PATCH v4 0/3] support dirty restraint on vCPU

2021-11-22 Thread huangy81
From: Hyman Huang(黄勇) v4: - rebase on master - modify the following points according to the advice given by Markus 1. move the defination into migration.json 2. polish the comments of set-dirty-limit 3. do the syntax check and change dirty rate to dirty page rate Thanks for the carefule re

[PATCH v5 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-24 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty restraint. Implement thread for calculate dirtyrate periodly, which will be used for dirty restraint. Add dirtylimit.h to introduce the util function for dirty limit

[PATCH v5 0/3] support dirty restraint on vCPU

2021-11-24 Thread huangy81
From: Hyman Huang(黄勇) v5: - rebase on master - adjust the throttle algorithm by removing the tuning in RESTRAINT_RATIO case so that dirty page rate could reachs the quota more quickly. - fix percentage update in throttle iteration. v4: - rebase on master - modify the following points accord

[PATCH v5 3/3] cpus-common: implement dirty limit on vCPU

2021-11-24 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty limit on vCPU. Signed-off-by: Hyman Huang(黄勇) --- cpus-com

[PATCH v5 2/3] cpu-throttle: implement vCPU throttle

2021-11-24 Thread huangy81
From: Hyman Huang(黄勇) Impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. Start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current a

[PATCH v6 0/3] support dirty restraint on vCPU

2021-11-25 Thread huangy81
From: Hyman Huang(黄勇) v6: - rebase on master - fix dirtylimit setup crash found by Markus - polish the comments according to the advice given by Markus - adjust the qemu qmp command tag to 7.0 v5: - rebase on master - adjust the throttle algorithm by removing the tuning in RESTRAINT_RATIO cas

[PATCH v6 2/3] cpu-throttle: implement vCPU throttle

2021-11-25 Thread huangy81
From: Hyman Huang(黄勇) Impose dirty restraint on vCPU by kicking it and sleep as the auto-converge does during migration, but just kick the specified vCPU instead, not all vCPUs of vm. Start a thread to track the dirtylimit status and adjust the throttle pencentage dynamically depend on current a

[PATCH v6 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-25 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirty page rate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty-limit to set/cancel dirty page limit on vCPU. Signed-off-by: Hyman Huang(黄勇) --

[PATCH v6 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-25 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly. Implement thread for calculating dirtyrate periodly, which will be used for for vCPU throttle implementation. Add dirtylimit.h to introduce the util function for dirty page li

[PATCH v25 0/8] support dirty restraint on vCPU

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) v25: - rebase master - fix 32-bit and non-Linux(freebsd) build failures use qatomic_read_i64() to replace qatomic_read() move the DIRTYLIMIT_TOLERANCE_RANGE MARCO out of 'linux' scope. Please review, thanks ! Yong. v24: - add "Acked-by: Peter Xu " tag in (PATCH [8/8])

[PATCH v25 1/8] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Add a non-required argument 'CPUState' to kvm_dirty_ring_reap so that it can cover single vcpu dirty-ring-reaping scenario. Signed-off-by: Hyman Huang(黄勇) Reviewed-by: Peter Xu --- accel/kvm/kvm-all.c | 23 +-- 1 file changed, 13 insertions(+), 10 del

[PATCH v25 5/8] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Introduce kvm_dirty_ring_size util function to help calculate dirty ring ful time. Signed-off-by: Hyman Huang(黄勇) Acked-by: Peter Xu --- accel/kvm/kvm-all.c| 5 + accel/stubs/kvm-stub.c | 5 + include/sysemu/kvm.h | 2 ++ 3 files changed, 12 insertions(+)

[PATCH v25 2/8] cpus: Introduce cpu_list_generation_id

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Introduce cpu_list_generation_id to track cpu list generation so that cpu hotplug/unplug can be detected during measurement of dirty page rate. cpu_list_generation_id could be used to detect changes of cpu list, which is prepared for dirty page rate measurement. Signed-off

[PATCH v25 3/8] migration/dirtyrate: Refactor dirty page rate calculation

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) abstract out dirty log change logic into function global_dirty_log_change. abstract out dirty page rate calculation logic via dirty-ring into function vcpu_calculate_dirtyrate. abstract out mathematical dirty page rate calculation into do_calculate_dirtyrate, decouple it f

[PATCH v25 4/8] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty page rate limit. Add dirtylimit.c to implement dirtyrate calculation periodly, which will be used for dirty page rate limit. Add dirtylimit.h to export util functions

[PATCH v25 7/8] softmmu/dirtylimit: Implement dirty page rate limit

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle virtual CPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "set-vcpu-dirty-limit", "cancel-vcpu-dirty-limit", "query-vcpu-dirty-limit" to enable, disable, query d

[PATCH v25 8/8] tests: Add dirty page rate limit test

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, The following qmp commands are covered by this test case: "calc-dirty-rate", "query-dirty-rate", "set-vcpu-dirty-limit", "cancel-vcpu-dirty-limit" and "query-vcpu-dirty-limit". Signed-off-by: Hyman Huang(黄勇) Ack

[PATCH v25 6/8] softmmu/dirtylimit: Implement virtual CPU throttle

2022-06-25 Thread huangy81
From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep throttle_us_per_full microseconds to throttle vCPU if dirtylimit is in service. Signed-off-by: Hyman Huang(黄勇) Revie

[PATCH v17 2/8] cpus: Introduce cpu_list_generation_id

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Introduce cpu_list_generation_id to track cpu list generation so that cpu hotplug/unplug can be detected during measurement of dirty page rate. cpu_list_generation_id could be used to detect changes of cpu list, which is prepared for dirty page rate measurement. Signed-off

[PATCH v17 3/8] migration/dirtyrate: Refactor dirty page rate calculation

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) abstract out dirty log change logic into function global_dirty_log_change. abstract out dirty page rate calculation logic via dirty-ring into function vcpu_calculate_dirtyrate. abstract out mathematical dirty page rate calculation into do_calculate_dirtyrate, decouple it f

[PATCH v17 6/8] softmmu/dirtylimit: Implement virtual CPU throttle

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep throttle_us_per_full microseconds to throttle vCPU if dirtylimit is in service. Signed-off-by: Hyman Huang(黄勇) Revie

[PATCH v17 0/8] support dirty restraint on vCPU

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) v17 - rebase on master - fix qmp-cmd-test v16 - rebase on master - drop the unused typedef syntax in [PATCH v15 6/7] - add the Reviewed-by and Acked-by tags by the way v15 - rebase on master - drop the 'init_time_ms' parameter in function vcpu_calculate_dirtyrate - dro

[PATCH v17 4/8] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty page rate limit. Add dirtylimit.c to implement dirtyrate calculation periodly, which will be used for dirty page rate limit. Add dirtylimit.h to export util functions

[PATCH v17 7/8] softmmu/dirtylimit: Implement dirty page rate limit

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle virtual CPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "set-vcpu-dirty-limit", "cancel-vcpu-dirty-limit", "query-vcpu-dirty-limit" to enable, disable, query d

[PATCH v17 8/8] tests/qtest/qmp-cmd-test: Ignore query-vcpu-dirty-limit test

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) query-vcpu-dirty-limit success depends on enabling dirty page rate limit, so just add it to the list of skipped command to ensure qmp-cmd-test run successfully. Signed-off-by: Hyman Huang(黄勇) Reported-by: Dr. David Alan Gilbert --- tests/qtest/qmp-cmd-test.c | 2 ++ 1 fi

[PATCH v17 1/8] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Add a non-required argument 'CPUState' to kvm_dirty_ring_reap so that it can cover single vcpu dirty-ring-reaping scenario. Signed-off-by: Hyman Huang(黄勇) Reviewed-by: Peter Xu --- accel/kvm/kvm-all.c | 23 +-- 1 file changed, 13 insertions(+), 10 del

[PATCH v17 5/8] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Introduce kvm_dirty_ring_size util function to help calculate dirty ring ful time. Signed-off-by: Hyman Huang(黄勇) Acked-by: Peter Xu --- accel/kvm/kvm-all.c| 5 + accel/stubs/kvm-stub.c | 5 + include/sysemu/kvm.h | 2 ++ 3 files changed, 12 insertions(+)

[PATCH v18 1/7] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Add a non-required argument 'CPUState' to kvm_dirty_ring_reap so that it can cover single vcpu dirty-ring-reaping scenario. Signed-off-by: Hyman Huang(黄勇) Reviewed-by: Peter Xu --- accel/kvm/kvm-all.c | 23 +-- 1 file changed, 13 insertions(+), 10 del

[PATCH v18 2/7] cpus: Introduce cpu_list_generation_id

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Introduce cpu_list_generation_id to track cpu list generation so that cpu hotplug/unplug can be detected during measurement of dirty page rate. cpu_list_generation_id could be used to detect changes of cpu list, which is prepared for dirty page rate measurement. Signed-off

[PATCH v18 3/7] migration/dirtyrate: Refactor dirty page rate calculation

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) abstract out dirty log change logic into function global_dirty_log_change. abstract out dirty page rate calculation logic via dirty-ring into function vcpu_calculate_dirtyrate. abstract out mathematical dirty page rate calculation into do_calculate_dirtyrate, decouple it f

[PATCH v18 7/7] softmmu/dirtylimit: Implement dirty page rate limit

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle virtual CPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "set-vcpu-dirty-limit", "cancel-vcpu-dirty-limit", "query-vcpu-dirty-limit" to enable, disable, query d

[PATCH v18 0/7] support dirty restraint on vCPU

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) v18 - squash commit "Ignore query-vcpu-dirty-limit test" into "Implement dirty page rate limit" in [PATCH v17] to make the modification logic self-contained. Please review. Thanks, Regards Yong v17 - rebase on master - fix qmp-cmd-test v16 - rebase on master - dr

[PATCH v18 5/7] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Introduce kvm_dirty_ring_size util function to help calculate dirty ring ful time. Signed-off-by: Hyman Huang(黄勇) Acked-by: Peter Xu --- accel/kvm/kvm-all.c| 5 + accel/stubs/kvm-stub.c | 5 + include/sysemu/kvm.h | 2 ++ 3 files changed, 12 insertions(+)

[PATCH v18 4/7] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty page rate limit. Add dirtylimit.c to implement dirtyrate calculation periodly, which will be used for dirty page rate limit. Add dirtylimit.h to export util functions

[PATCH v18 6/7] softmmu/dirtylimit: Implement virtual CPU throttle

2022-03-02 Thread huangy81
From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep throttle_us_per_full microseconds to throttle vCPU if dirtylimit is in service. Signed-off-by: Hyman Huang(黄勇) Revie

[PATCH] introduce dirty ring size for guestperf tool

2022-03-03 Thread huangy81
From: Hyman Huang(黄勇) Dirtylimit implementation has been reviewed in the past few months, if things go well, it will be merged in the near future, which is the first step to implement a new live migration feature. For more details refer to: https://lore.kernel.org/qemu-devel/cover.1646247968.git

  1   2   3   4   5   >