[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] migrate: replace the cpu throttle percentage ma
From: |
Li Qiang |
Subject: |
[Qemu-devel] [PATCH 1/3] migrate: replace the cpu throttle percentage max with a variable |
Date: |
Tue, 31 Jul 2018 01:35:22 -0700 |
So we can config it using qmp.
Signed-off-by: Li Qiang <address@hidden>
---
cpus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index b5844b7103..6569c73d24 100644
--- a/cpus.c
+++ b/cpus.c
@@ -83,6 +83,8 @@ static unsigned int throttle_percentage;
#define CPU_THROTTLE_PCT_MAX 99
#define CPU_THROTTLE_TIMESLICE_NS 10000000
+static unsigned int throttle_percentage_max = CPU_THROTTLE_PCT_MAX;
+
bool cpu_is_stopped(CPUState *cpu)
{
return cpu->stopped || !runstate_is_running();
@@ -754,7 +756,7 @@ static void cpu_throttle_timer_tick(void *opaque)
void cpu_throttle_set(int new_throttle_pct)
{
/* Ensure throttle percentage is within valid range */
- new_throttle_pct = MIN(new_throttle_pct, CPU_THROTTLE_PCT_MAX);
+ new_throttle_pct = MIN(new_throttle_pct, throttle_percentage_max);
new_throttle_pct = MAX(new_throttle_pct, CPU_THROTTLE_PCT_MIN);
atomic_set(&throttle_percentage, new_throttle_pct);
--
2.11.0
- [Qemu-devel] [PATCH 0/3] Add a new migrate_set_max_cpu_throttle qmp command, Li Qiang, 2018/07/31
- [Qemu-devel] [PATCH 1/3] migrate: replace the cpu throttle percentage max with a variable,
Li Qiang <=
- [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Li Qiang, 2018/07/31
- Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Dr. David Alan Gilbert, 2018/07/31
- Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Eric Blake, 2018/07/31
- Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Juan Quintela, 2018/07/31
- Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Dr. David Alan Gilbert, 2018/07/31
- Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Daniel P . Berrangé, 2018/07/31
- Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle, Li Qiang, 2018/07/31
[Qemu-devel] [PATCH 3/3] hmp: add hmp for migrate_set_max_cpu_throttle, Li Qiang, 2018/07/31