[PATCH v2 2/2] vhost-net: Fix the virtio features negotiation flaw

2022-10-28 Thread huangy81
From: Hyman Huang(黄勇) Save the acked_features once it be configured by guest virtio driver so it can't miss any features. Signed-off-by: Hyman Huang(黄勇) Signed-off-by: Guoyi Tu --- hw/net/vhost_net.c | 9 + hw/net/virtio-net.c | 5 + include/net/vhost_net.h | 2 ++ 3 file

[PATCH v2 1/2] vhost-user: Refactor vhost acked features saving

2022-10-28 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 | 2 ++ net/vhost-user.c | 35 +++ 2 files c

[PATCH v3 1/2] vhost-user: Refactor vhost acked features saving

2022-10-30 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 | 2 ++ net/vhost-user.c | 29 ++--- 2 files changed

[PATCH v3 2/2] vhost-net: Fix the virtio features negotiation flaw

2022-10-30 Thread huangy81
From: Hyman Huang(黄勇) Save the acked_features once it be configured by guest virtio driver so it can't miss any features. Note that this patch also change the features saving logic in chr_closed_bh, which originally backup features no matter whether the features are 0 or not, but now do it only

[PATCH v3 0/2] Fix the virtio features negotiation flaw

2022-10-30 Thread huangy81
From: Hyman Huang(黄勇) v3: -rebase on master -code clean on [PATCH v2 1/2]: keep the commit self-consistent and do not modify the logic of saving acked_features. Just abstract the util function. -modify the [PATCH v2 2/2] logic: change the behavior of saving acked_features in chr_closed_bh: sav

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

2022-12-19 Thread huangy81
From: Hyman Huang(黄勇) v5: -fix the assert statement in [PATCH v4 3/3], reported by xiangdong. 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

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

2022-12-19 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 40a2fe8.

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

2022-12-19 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 v5 3/3] vhost-user: Fix the virtio features negotiation flaw

2022-12-19 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 RESEND v5 0/3] Fix the virtio features negotiation flaw

2022-12-20 Thread huangy81
From: Hyman Huang(黄勇) v5(resend): -rebase on master v5: -fix the assert statement in [PATCH v4 3/3], reported by xiangdong. 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 RESEND v5 1/3] vhost-user: Refactor vhost acked features saving

2022-12-20 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 RESEND v5 2/3] vhost-user: Refactor the chr_closed_bh

2022-12-20 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 RESEND v5 3/3] vhost-user: Fix the virtio features negotiation flaw

2022-12-20 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 v6 0/3] Fix the virtio features negotiation flaw

2022-12-21 Thread huangy81
From: Hyman Huang(黄勇) v6: -rebase on master -fix the compling issue vhost_user_save_acked_features symbol only exists when "vhost-user" be configured. Add MACRO statement before calling vhost_user_save_acked_features. Thanks Michael for pointing out that issue in time. Please review, Yong

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

2022-12-21 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 v6 3/3] vhost-user: Fix the virtio features negotiation flaw

2022-12-21 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 v6 2/3] vhost-user: Refactor the chr_closed_bh

2022-12-21 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.

[RFC PATCH 2/2] tests: Add dirty page rate limit test

2022-03-09 Thread huangy81
From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, create a standalone file to implement the test case. Signed-off-by: Hyman Huang(黄勇) --- tests/qtest/dirtylimit-test.c | 288 ++ tests/qtest/meson.build | 2 + 2 fi

[RFC PATCH 1/2] migration-test: Export migration-test util funtions

2022-03-09 Thread huangy81
From: Hyman Huang(黄勇) Dirtylimit qtest can reuse the mechanisms that have been implemented by migration-test to start a vm, so export the relevant util functions. Signed-off-by: Hyman Huang(黄勇) --- tests/qtest/migration-helpers.c | 95 + tests/qtest/migrati

[RFC PATCH 0/2] Add dirty page rate limit qtest

2022-03-09 Thread huangy81
From: Hyman Huang(黄勇) This patchset is dirtylimit qtest and plan to be a supplement for patch series "support dirty restraint on vCPU". Dirtylimit qtest use the existing bootsect in tests/migration/i386 to start test vm. The x86.bootsect repeatedly increments the first byte of each page in a 100

[PATCH v19 2/9] cpus: Introduce cpu_list_generation_id

2022-03-15 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 v19 4/9] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically

2022-03-15 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 v19 0/9] support dirty restraint on vCPU

2022-03-15 Thread huangy81
From: Hyman Huang(黄勇) v19 - rebase on master and fix conflicts - add test case for dirty page rate limit Ping. Adding an test case and hope it can be merged along with previous patchset by the way. Please review. Thanks, Regards Yong v18 - squash commit "Ignore query-vcpu-dirty-limit test" i

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

2022-03-15 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 v19 3/9] migration/dirtyrate: Refactor dirty page rate calculation

2022-03-15 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 v19 5/9] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-03-15 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 | 6 ++ include/sysemu/kvm.h | 2 ++ 3 files changed, 13 insertions(+)

[PATCH v19 6/9] softmmu/dirtylimit: Implement virtual CPU throttle

2022-03-15 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 v19 7/9] softmmu/dirtylimit: Implement dirty page rate limit

2022-03-15 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 v19 8/9] migration-test: Export migration-test util funtions

2022-03-15 Thread huangy81
From: Hyman Huang(黄勇) Dirtylimit qtest can reuse the mechanisms that have been implemented by migration-test to start a vm, so export the relevant util functions. Signed-off-by: Hyman Huang(黄勇) --- tests/qtest/migration-helpers.c | 95 + tests/qtest/migrati

[PATCH v19 9/9] tests: Add dirty page rate limit test

2022-03-15 Thread huangy81
From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, create a standalone file to implement the test case. 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-vc

[PATCH v20 2/9] cpus: Introduce cpu_list_generation_id

2022-03-15 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 v20 1/9] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping

2022-03-15 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 v20 3/9] migration/dirtyrate: Refactor dirty page rate calculation

2022-03-15 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 v20 6/9] softmmu/dirtylimit: Implement virtual CPU throttle

2022-03-15 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 v20 0/9] support dirty restraint on vCPU

2022-03-15 Thread huangy81
From: Hyman Huang(黄勇) v20 - fix the style problems and let QEMU test pass - change the dirty limit case logic: test fail if dirtyrate measurement 200ms timeout v19 - rebase on master and fix conflicts - add test case for dirty page rate limit Ping. Adding an test case and hope it can be merg

[PATCH v20 8/9] migration-test: Export migration-test util funtions

2022-03-15 Thread huangy81
From: Hyman Huang(黄勇) Dirtylimit qtest can reuse the mechanisms that have been implemented by migration-test to start a vm, so export the relevant util functions. Signed-off-by: Hyman Huang(黄勇) --- tests/qtest/migration-helpers.c | 95 + tests/qtest/migrati

[PATCH v20 4/9] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically

2022-03-15 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 v20 5/9] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-03-15 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 | 6 ++ include/sysemu/kvm.h | 2 ++ 3 files changed, 13 insertions(+)

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

2022-03-15 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 v20 9/9] tests: Add dirty page rate limit test

2022-03-15 Thread huangy81
From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, create a standalone file to implement the test case. 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-vc

[PATCH v21 2/9] cpus: Introduce cpu_list_generation_id

2022-03-16 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 v21 7/9] softmmu/dirtylimit: Implement dirty page rate limit

2022-03-16 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 v21 9/9] tests: Add dirty page rate limit test

2022-03-16 Thread huangy81
From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, create a standalone file to implement the test case. 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-vc

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

2022-03-16 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 v21 0/9] support dirty restraint on vCPU

2022-03-16 Thread huangy81
From: Hyman Huang(黄勇) v21 - remove the tmpfs declarations in header file and test case should use tmpfs as internal var respectively. v20 - fix the style problems and let QEMU test pass - change the dirty limit case logic: test fail if dirtyrate measurement 200ms timeout v19 - rebase on mas

[PATCH v21 3/9] migration/dirtyrate: Refactor dirty page rate calculation

2022-03-16 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 v21 5/9] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-03-16 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 | 6 ++ include/sysemu/kvm.h | 2 ++ 3 files changed, 13 insertions(+)

[PATCH v21 4/9] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically

2022-03-16 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 v21 8/9] migration-test: Export migration-test util funtions

2022-03-16 Thread huangy81
From: Hyman Huang(黄勇) Dirtylimit qtest can reuse the mechanisms that have been implemented by migration-test to start a vm, so export the relevant util functions. Signed-off-by: Hyman Huang(黄勇) --- tests/qtest/migration-helpers.c | 87 ++ tests/qtest/migration-helpers.

[PATCH v21 6/9] softmmu/dirtylimit: Implement virtual CPU throttle

2022-03-16 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 v2] tests/migration: Introduce dirty-ring-size option into guestperf

2022-03-16 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] Introduce dirty ring live migration test for guestperf

2022-03-16 Thread huangy81
From: Hyman Huang(黄勇) v2: - rebase on master - fix style problems and make qemu test passes Ping Please review. Thanks, Regards Yong v1: - original version sent by accident, send the right patch Dirtylimit implementation has been reviewed in the past few months, if things go well, it will be

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

2022-03-31 Thread huangy81
From: Hyman Huang(黄勇) This is v22 of dirtylimit series. The following is the history of the patchset, since v22 kind of different from the original version, i made abstracts of changelog: RFC and v1: https://lore.kernel.org/qemu-devel/cover.1637214721.git.huang...@chinatelecom.cn/ v2: https:/

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

2022-03-31 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 v22 3/8] migration/dirtyrate: Refactor dirty page rate calculation

2022-03-31 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 v22 2/8] cpus: Introduce cpu_list_generation_id

2022-03-31 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 v22 7/8] softmmu/dirtylimit: Implement dirty page rate limit

2022-03-31 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 v22 5/8] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function

2022-03-31 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 | 6 ++ include/sysemu/kvm.h | 2 ++ 3 files changed, 13 insertions(+)

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

2022-03-31 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 v22 6/8] softmmu/dirtylimit: Implement virtual CPU throttle

2022-03-31 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 v22 8/8] tests: Add dirty page rate limit test

2022-03-31 Thread huangy81
From: Hyman Huang(黄勇) Add dirty page rate limit test if kernel support dirty ring, create a standalone file to implement the test case. 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-vc

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

2021-11-29 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 v7 2/3] cpu-throttle: implement vCPU throttle

2021-11-29 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 v7 0/3] support dirty restraint on vCPU

2021-11-29 Thread huangy81
From: Hyman Huang(黄勇) The patch [2/3] has not been touched so far. Any corrections and suggetions are welcome. Please review, thanks! v7: - rebase on master - polish the comments and error message according to the advices given by Markus - introduce dirtylimit_enabled function to pre-check i

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

2021-11-30 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 v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 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 v7 2/3] cpu-throttle: implement vCPU throttle

2021-11-30 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 v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread huangy81
From: Hyman Huang(黄勇) The patch [2/3] has not been touched so far. Any corrections and suggetions are welcome. Please review, thanks! v7: - rebase on master - polish the comments and error message according to the advices given by Markus - introduce dirtylimit_enabled function to pre-check i

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

2021-12-02 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 v8 2/3] cpu-throttle: implement vCPU throttle

2021-12-02 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 v8 0/3] support dirty restraint on vCPU

2021-12-02 Thread huangy81
From: Hyman Huang(黄勇) v8: - rebase on master - polish the error message and remove the "unlikely" compilation syntax according to the advice given by Markus. - keep the dirty tracking enabled during "dirtylimit-calc" lifecycle so that the overhead can be reduced according to the advice given

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

2021-12-02 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 "vcpu-dirty-limit", "query-vcpu-dirty-limit" to enable, disable, query dirty page limit for virtual CPU. Mean

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

2021-12-02 Thread huangy81
From: Hyman Huang(黄勇) v9: - rebase on master - fix the meson directory change, keep it untouched. v8: - rebase on master - polish the error message and remove the "unlikely" compilation syntax according to the advice given by Markus. - keep the dirty tracking enabled during "dirtylimit-calc" l

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

2021-12-02 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 v9 3/3] cpus-common: implement dirty page limit on vCPU

2021-12-02 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 "vcpu-dirty-limit", "query-vcpu-dirty-limit" to enable, disable, query dirty page limit for virtual CPU. Mean

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

2021-12-02 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 v10 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-12-14 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 page limit. Add dirtylimit.h to introduce the util function for dirty limit

[PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2021-12-14 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 enabled. Start a thread to track current dirty pa

[PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-14 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 "vcpu-dirty-limit", "query-vcpu-dirty-limit" to enable, disable, query dirty page limit for virtual CPU

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

2021-12-14 Thread huangy81
From: Hyman Huang(黄勇) v10: - rebase on master - make the following modifications on patch [1/3]: 1. Make "dirtylimit-calc" thread joinable and join it after quitting. 2. Add finalize function to free dirtylimit_calc_state 3. Do some code clean work - make the following modifications on p

[PATCH v2] make sample page count configurable

2021-05-08 Thread huangy81
From: Hyman Huang(黄勇) This is v2 of introducing sample pages argument to dirty rate interface v2: - do the code clean on the basis of review by David - add qemu version to 6.1 since which the argument introduced - raise the upper limit of sample pages refer as MAX_SAMPLE_PAGE_COUNT v1: - code

[PATCH v2] migration/dirtyrate: make sample page count configurable

2021-05-08 Thread huangy81
From: Hyman Huang(黄勇) introduce optional sample-pages argument in calc-dirty-rate, making sample page count per GB configurable so that more accurate dirtyrate can be calculated. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 31 --- migration/dirtyrate.h | 8 -

[PATCH v3] migration/dirtyrate: make sample page count configurable

2021-05-11 Thread huangy81
From: Hyman Huang(黄勇) introduce optional sample-pages argument in calc-dirty-rate, making sample page count per GB configurable so that more accurate dirtyrate can be calculated. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 31 +++ migration/dirtyrate.

[PATCH v3] make sample page count configurable

2021-05-11 Thread huangy81
From: Hyman Huang(黄勇) This is v3 of introducing sample pages argument to dirty rate interface v3: - only add the "6.1" tag to the sample-pages field of DirtyRateInfo v2: - do the code clean on the basis of review by David - add qemu version to 6.1 since which the argument introduced - raise th

[PATCH] tests/migration: introduce multifd into guestperf

2021-03-18 Thread huangy81
From: Hyman Current guestperf tool does not support multifd migration, introducing multifd is good idea so that we can compare the performence of all type of migration. To request that multifd is enabled, with 4 channels: $ ./tests/migration/guestperf.py \ --multifd --multifd-channels 4 --ou

[PATCH] MAINTAINERS: Fix tests/migration maintainers

2021-03-18 Thread huangy81
From: Hyman Signed-off-by: Hyman --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 25fc49d..20e2387 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2525,6 +2525,7 @@ M: Cleber Rosa S: Odd Fixes F: scripts/*.py F: tests/*.py +F: tests/migratio

[PATCH v1] MAINTAINERS: Fix tests/migration maintainers

2021-03-18 Thread huangy81
From: Hyman Huang(黄勇) Signed-off-by: Hyman Huang(黄勇) --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 25fc49d1dc..20e2387c66 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2525,6 +2525,7 @@ M: Cleber Rosa S: Odd Fixes F: scripts/*.py F: tes

[PATCH v2] MAINTAINERS: Fix tests/migration maintainers

2021-03-19 Thread huangy81
From: Hyman Huang(黄勇) when executing the following scripts, it throw error message: $ ./scripts/get_maintainer.pl -f tests/migration/guestperf.py get_maintainer.pl: No maintainers found, printing recent contributors. get_maintainer.pl: Do not blindly cc: them on patches! Use common sense. add t

[PATCH v1] tests/migration: introduce multifd into guestperf

2021-03-19 Thread huangy81
From: Hyman Guestperf tool does not cover the multifd-enabled migration currently, it is worth supporting so that developers can analysis the migration performance with all kinds of migration. To request that multifd is enabled, with 4 channels: $ ./tests/migration/guestperf.py \ --multifd -

[PATCH v1] introduce multifd into guestperf

2021-03-19 Thread huangy81
From: Hyman Huang(黄勇) This is the v1 of guestperf multifd migration support It is merely the same as the original patch, just change the maintainer, since the ./scripts/get_maintainer.pl do not get the maintainer of tests/migration before this patch: https://lore.kernel.org/qemu-devel/842e7cbd-

[PATCH] tests/migration: fix parameter of auto-converge migration

2021-03-23 Thread huangy81
From: Hyman Huang(黄勇) when execute the following test command: $ ./guestperf-batch.py --auto-converge \ --auto-converge-step {percent} ... test aborts and error message be throwed as the following: "Parameter 'x-cpu-throttle-increment' is unexpected" The reason is that 'x-cpu-throttle-increm

[PATCH v1] migration/dirtyrate: make sample page count configurable

2021-04-14 Thread huangy81
From: Hyman Huang(黄勇) introduce optional sample-pages argument in calc-dirty-rate, making sample page count per GB configurable so that more accurate dirtyrate can be calculated. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 32 migration/dirtyrate

[PATCH] migration/dirtyrate: make sample page count configurable

2021-04-14 Thread huangy81
From: Hyman Huang(黄勇) introduce optional sample-pages argument in calc-dirty-rate, making sample page count per GB configurable so that more accurate dirtyrate can be calculated. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 32 migration/dirtyrate

[RFC] tests/migration: introduce multifd into guestperf toolkit

2021-03-10 Thread huangy81
From: Hyman Current guestperf tool does not support multifd migration, introducing it is good idea so that we can compare the performence of all type of migration. Signed-off-by: Hyman --- tests/migration/guestperf/comparison.py | 14 ++ tests/migration/guestperf/engine.py | 16

[PATCH v1 0/6] support dirtyrate at the granualrity of vcpu

2021-05-31 Thread huangy81
From: Hyman Huang(黄勇) Since the Dirty Ring on QEMU part has been merged recently, how to use this feature is under consideration. In the scene of migration, it is valuable to provide a more accurante interface to track dirty memory than existing one, so that the upper layer application can make

[PATCH v1 3/6] migration/dirtyrate: add vcpu option for qmp calc-dirty-rate

2021-05-31 Thread huangy81
From: Hyman Huang(黄勇) calculate dirtyrate for each vcpu if vcpu is true, add the dirtyrate of each vcpu to the return value also. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 5 - migration/dirtyrate.h | 1 + qapi/migration.json | 28 ++-- 3 files

[PATCH v1 1/6] KVM: add kvm_dirty_ring_enabled function

2021-05-31 Thread huangy81
From: Hyman Huang(黄勇) introduce kvm_dirty_ring_enabled to show if kvm-reaper is working. dirtyrate thread could use it to check if calculation can base on dirty ring feature. Signed-off-by: Hyman Huang(黄勇) --- accel/kvm/kvm-all.c | 5 + include/sysemu/kvm.h | 1 + 2 files changed, 6 inser

[PATCH v1 5/6] migration/dirtyrate: check support of calculation for vcpu

2021-05-31 Thread huangy81
From: Hyman Huang(黄勇) vcpu method only works when kvm dirty ring is enabled, use kvm_dirty_ring_enabled to probe if dirty ring is enabled. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/migration/dirtyrate.c b/migration/

[PATCH v1 4/6] migration/dirtyrate: adjust struct DirtyRateStat

2021-05-31 Thread huangy81
From: Hyman Huang(黄勇) use union to store stat data of two mutual exclusive methods. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 32 migration/dirtyrate.h | 18 +++--- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/mi

[PATCH v1 2/6] KVM: introduce dirty_pages into CPUState

2021-05-31 Thread huangy81
From: Hyman Huang(黄勇) dirty_pages is used to calculate dirtyrate via dirty ring, when enabled, kvm-reaper will increase the dirty pages after gfns being dirtied. Signed-off-by: Hyman Huang(黄勇) --- accel/kvm/kvm-all.c | 6 ++ include/hw/core/cpu.h | 2 ++ 2 files changed, 8 insertions(+)

<    1   2   3   4   5   >