qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V6 1/5] throttle: Add a new throttling API imple


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH V6 1/5] throttle: Add a new throttling API implementing continuous leaky bucket.
Date: Wed, 28 Aug 2013 16:07:42 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Aug 26, 2013 at 04:42:48PM +0200, Benoît Canet wrote:
> +/* fix bucket parameters */
> +static void throttle_fix_bucket(LeakyBucket *bkt)
> +{
> +    double min;
> +
> +    /* zero bucket level */
> +    bkt->level = 0;
> +
> +    /* The following is done to cope with the cfg block scheduler which 
> regroup

s/cfg/Linux CFQ/ ?

> +/* used to get config
> + *
> + * @ts:  the throttle state we are working on
> + * @ret: the config
> + */
> +ThrottleConfig *throttle_get_config(ThrottleState *ts)
> +{
> +    return &ts->cfg;
> +}

throttle_config() copies the ThrottleConfig struct but this returns a
non-const pointer to it.  Should this function copy it too?

void throttle_get_config(ThrottleState *ts, ThrottleConfig *cfg)
{
    *cfg = ts->cfg;
}

> +/* do the accounting for this operation
> + *
> + * @is_write: the type of operation (read/write)
> + * size:      the size of the operation

s/size/@size/

> + */
> +void throttle_account(ThrottleState *ts, bool is_write, uint64_t size)
> +{
> +    double units = 1.0;
> +
> +    /* if cfg.op_size is not defined we will acccount exactly 1 operation */

s/acccount/account/



reply via email to

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