qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH QEMU v5 7/8] migration: Extend query-migrate to provide dirty


From: Juan Quintela
Subject: Re: [PATCH QEMU v5 7/8] migration: Extend query-migrate to provide dirty page limit info
Date: Tue, 13 Jun 2023 20:07:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

~hyman <hyman@git.sr.ht> wrote:
> From: Hyman Huang(黄勇) <yong.huang@smartx.com>
>
> Extend query-migrate to provide throttle time and estimated
> ring full time with dirty-limit capability enabled, through which
> we can observe if dirty limit take effect during live migration.
>
> Signed-off-by: Hyman Huang(黄勇) <yong.huang@smartx.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Nit for the resent.

> +int64_t dirtylimit_throttle_time_per_round(void);
> +int64_t dirtylimit_ring_full_time(void);

int64?
> @@ -267,7 +278,9 @@
>             '*postcopy-blocktime' : 'uint32',
>             '*postcopy-vcpu-blocktime': ['uint32'],
>             '*compression': 'CompressionStats',
> -           '*socket-address': ['SocketAddress'] } }
> +           '*socket-address': ['SocketAddress'],
> +           '*dirty-limit-throttle-time-per-round': 'int64',
> +           '*dirty-limit-ring-full-time': 'int64'} }

int64


> +/* Return the max throttle time of each virtual CPU */
> +int64_t dirtylimit_throttle_time_per_round(void)
> +{
> +    CPUState *cpu;
> +    int64_t max = 0;
> +
> +    CPU_FOREACH(cpu) {
> +        if (cpu->throttle_us_per_full > max) {
> +            max = cpu->throttle_us_per_full;
> +        }
> +    }
> +
> +    return max;
> +}

s/int64_t/uint64_t/?

> +
> +/*
> + * Estimate average dirty ring full time of each virtaul CPU.
> + * Return -1 if guest doesn't dirty memory.
> + */
> +int64_t dirtylimit_ring_full_time(void)
> +{
> +    CPUState *cpu;
> +    uint64_t curr_rate = 0;
> +    int nvcpus = 0;
> +
> +    CPU_FOREACH(cpu) {
> +        if (cpu->running) {
> +            nvcpus++;
> +            curr_rate += vcpu_dirty_rate_get(cpu->cpu_index);
> +        }
> +    }
> +
> +    if (!curr_rate || !nvcpus) {
> +        return -1;

What does -1 brings up that 0 don't?

i.e. returning 0 here would mean that nothing has been dirtied or that
we don't have any vcpus running, right?

Later, Juan.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]