qemu-devel
[Top][All Lists]
Advanced

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

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


From: Peter Xu
Subject: Re: [PATCH v14 7/7] softmmu/dirtylimit: Implement dirty page rate limit
Date: Mon, 14 Feb 2022 16:25:52 +0800

On Fri, Feb 11, 2022 at 12:17:41AM +0800, huangy81@chinatelecom.cn wrote:
> +static struct DirtyLimitInfoList *dirtylimit_query_all(void)
> +{
> +    int i, index;
> +    DirtyLimitInfo *info = NULL;
> +    DirtyLimitInfoList *head = NULL, **tail = &head;
> +
> +    dirtylimit_state_lock();
> +
> +    if (!dirtylimit_in_service()) {

Need to unlock?

> +        return NULL;
> +    }
> +
> +    for (i = 0; i < dirtylimit_state->max_cpus; i++) {
> +        index = dirtylimit_state->states[i].cpu_index;
> +        if (dirtylimit_vcpu_get_state(index)->enabled) {
> +            info = dirtylimit_query_vcpu(index);
> +            QAPI_LIST_APPEND(tail, info);
> +        }
> +    }
> +
> +    dirtylimit_state_unlock();
> +
> +    return head;
> +}

-- 
Peter Xu




reply via email to

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