dirtylimit.c (aeaafb1e59f81f5cc715e656dac23f3fe5db3faa) dirtylimit.c (714f33123bfc73c6caacd19a44e082da8cdc96e3)
1/*
2 * Dirty page rate limit implementation code
3 *
4 * Copyright (c) 2022 CHINA TELECOM CO.,LTD.
5 *
6 * Authors:
7 * Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
8 *

--- 63 unchanged lines hidden (view full) ---

72/* protect dirtylimit_state */
73static QemuMutex dirtylimit_mutex;
74
75/* dirtylimit thread quit if dirtylimit_quit is true */
76static bool dirtylimit_quit;
77
78static void vcpu_dirty_rate_stat_collect(void)
79{
1/*
2 * Dirty page rate limit implementation code
3 *
4 * Copyright (c) 2022 CHINA TELECOM CO.,LTD.
5 *
6 * Authors:
7 * Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
8 *

--- 63 unchanged lines hidden (view full) ---

72/* protect dirtylimit_state */
73static QemuMutex dirtylimit_mutex;
74
75/* dirtylimit thread quit if dirtylimit_quit is true */
76static bool dirtylimit_quit;
77
78static void vcpu_dirty_rate_stat_collect(void)
79{
80 MigrationState *s = migrate_get_current();
81 VcpuStat stat;
82 int i = 0;
83 int64_t period = DIRTYLIMIT_CALC_TIME_MS;
84
85 if (migrate_dirty_limit() &&
86 migration_is_active()) {
80 VcpuStat stat;
81 int i = 0;
82 int64_t period = DIRTYLIMIT_CALC_TIME_MS;
83
84 if (migrate_dirty_limit() &&
85 migration_is_active()) {
87 period = s->parameters.x_vcpu_dirty_limit_period;
86 period = migrate_vcpu_dirty_limit_period();
88 }
89
90 /* calculate vcpu dirtyrate */
91 vcpu_calculate_dirtyrate(period,
92 &stat,
93 GLOBAL_DIRTY_LIMIT,
94 false);
95

--- 586 unchanged lines hidden ---
87 }
88
89 /* calculate vcpu dirtyrate */
90 vcpu_calculate_dirtyrate(period,
91 &stat,
92 GLOBAL_DIRTY_LIMIT,
93 false);
94

--- 586 unchanged lines hidden ---