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 7/9] throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code
Date: Thu, 27 Jul 2023 17:44:46 +0200 [thread overview]
Message-ID: <aa10c7e8-0941-8f10-39c4-0bae8f79b10e@redhat.com> (raw)
In-Reply-To: <20230724100939.1022984-8-pizhenwei@bytedance.com>
On 24.07.23 12:09, zhenwei pi wrote:
> The first dimension of both to_check and
> bucket_types_size/bucket_types_units is used as throttle direction,
> use THROTTLE_MAX instead of hard coded number. Also use ARRAY_SIZE()
> to avoid hard coded number for the second dimension.
>
> Hanna noticed that the two array should be static. Yes, turn them
> into static variables.
>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
> util/throttle.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
Using ARRAY_SIZE() for the other dimension is quite nice, too, indeed.
Thanks!
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
next prev parent reply other threads:[~2023-07-27 17:14 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
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 [this message]
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=aa10c7e8-0941-8f10-39c4-0bae8f79b10e@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).