qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Czenczek <hreitz@redhat.com>
To: zhenwei pi <pizhenwei@bytedance.com>,
	berto@igalia.com, kwolf@redhat.com,  groug@kaod.org,
	qemu_oss@crudebyte.com
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, berrange@redhat.com
Subject: Re: [PATCH v4 6/9] throttle: use enum ThrottleDirection instead of bool is_write
Date: Thu, 27 Jul 2023 17:41:39 +0200	[thread overview]
Message-ID: <1c703fbb-41a9-a702-e051-ccb950cb70f6@redhat.com> (raw)
In-Reply-To: <20230724100939.1022984-7-pizhenwei@bytedance.com>

On 24.07.23 12:09, zhenwei pi wrote:
> enum ThrottleDirection is already there, use ThrottleDirection instead
> of 'bool is_write' for throttle API, also modify related codes from
> block, fsdev, cryptodev and tests.
>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
>   backends/cryptodev.c        |  9 +++++----
>   block/throttle-groups.c     |  6 ++++--
>   fsdev/qemu-fsdev-throttle.c |  8 +++++---
>   include/qemu/throttle.h     |  5 +++--
>   tests/unit/test-throttle.c  |  4 ++--
>   util/throttle.c             | 31 +++++++++++++++++--------------
>   6 files changed, 36 insertions(+), 27 deletions(-)

[...]

> diff --git a/util/throttle.c b/util/throttle.c
> index 0439028d21..9a37209bb8 100644
> --- a/util/throttle.c
> +++ b/util/throttle.c
> @@ -136,11 +136,11 @@ int64_t throttle_compute_wait(LeakyBucket *bkt)
>   
>   /* This function compute the time that must be waited while this IO
>    *
> - * @is_write:   true if the current IO is a write, false if it's a read
> + * @throttle:   throttle direction

The parameter is now named @direction, so this should be changed. (Same 
in all other comments describing functions in this patch.)

With that done (in all 4 places):

Reviewed-by: Hanna Czenczek <hreitz@redhat.com>

>    * @ret:        time to wait
>    */
>   static int64_t throttle_compute_wait_for(ThrottleState *ts,
> -                                         bool is_write)
> +                                         ThrottleDirection direction)
>   {
>       BucketType to_check[2][4] = { {THROTTLE_BPS_TOTAL,
>                                      THROTTLE_OPS_TOTAL,



  reply	other threads:[~2023-07-27 15:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 10:09 [PATCH v4 0/9] Misc fixes for throttle zhenwei pi
2023-07-24 10:09 ` [PATCH v4 1/9] throttle: introduce enum ThrottleDirection zhenwei pi
2023-07-24 10:09 ` [PATCH v4 2/9] test-throttle: use " zhenwei pi
2023-07-24 10:09 ` [PATCH v4 3/9] throttle: support read-only and write-only zhenwei pi
2023-07-24 10:09 ` [PATCH v4 4/9] test-throttle: test read only and write only zhenwei pi
2023-07-24 10:09 ` [PATCH v4 5/9] cryptodev: use NULL throttle timer cb for read direction zhenwei pi
2023-07-24 10:09 ` [PATCH v4 6/9] throttle: use enum ThrottleDirection instead of bool is_write zhenwei pi
2023-07-27 15:41   ` Hanna Czenczek [this message]
2023-07-24 10:09 ` [PATCH v4 7/9] throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code zhenwei pi
2023-07-27 15:44   ` Hanna Czenczek
2023-07-24 10:09 ` [PATCH v4 8/9] fsdev: Use ThrottleDirection instread of bool is_write zhenwei pi
2023-07-27 15:48   ` Hanna Czenczek
2023-07-24 10:09 ` [PATCH v4 9/9] block/throttle-groups: " zhenwei pi
2023-07-27 16:12   ` Hanna Czenczek
2023-07-28  2:19     ` zhenwei pi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c703fbb-41a9-a702-e051-ccb950cb70f6@redhat.com \
    --to=hreitz@redhat.com \
    --cc=berrange@redhat.com \
    --cc=berto@igalia.com \
    --cc=groug@kaod.org \
    --cc=kwolf@redhat.com \
    --cc=pizhenwei@bytedance.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).