From: Manos Pitsidianakis <el13635@mail.ntua.gr>
To: Alberto Garcia <berto@igalia.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
qemu-block <qemu-block@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember
Date: Tue, 27 Jun 2017 15:24:09 +0300 [thread overview]
Message-ID: <20170627122409.2kot2sct56m6mmgg@postretch> (raw)
In-Reply-To: <w51bmp9zl7t.fsf@maestria.local.igalia.com>
[-- Attachment #1: Type: text/plain, Size: 3553 bytes --]
On Tue, Jun 27, 2017 at 02:08:54PM +0200, Alberto Garcia wrote:
>On Fri 23 Jun 2017 02:46:53 PM CEST, Manos Pitsidianakis wrote:
>> This commit gathers ThrottleGroup membership details from
>> BlockBackendPublic into ThrottleGroupMember and refactors existing code
>> to use the structure.
>>
>> Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
>
>Hey Manos, thanks for the patch. It looks good to me in general, I only
>have a couple of comments:
>
>> /* If no IO are queued for scheduling on the next round robin token
>> - * then decide the token is the current bs because chances are
>> - * the current bs get the current request queued.
>> + * then decide the token is the current tgm because chances are
>> + * the current tgm get the current request queued.
>
>I wonder if it's not better to use 'member' instead of 'tgm' in general.
>My impression is that the former is clearer and not too long, but I
>don't have a very strong opinion so you can keep it like this if you
>want.
I will change it, no problem,
>> -/* Check if an I/O request needs to be throttled, wait and set a timer
>> - * if necessary, and schedule the next request using a round robin
>> - * algorithm.
>> +/* Check if an I/O request needs to be throttled, wait and set a timer if
>> + * necessary, and schedule the next request using a round robin algorithm.
>> *
>
>There's a few cases like this when you reformat a paragraph but don't
>actually change the text. I think it just adds unnecessary noise to the
>diff...
Wiki says "It's OK to fix coding style issues in the immediate area (few
lines) of the lines you're changing" so I left the reformats. Since they
are noticed they must be too noisey.. I will either remove the changes
or do a restyling patch later.
>> --- a/include/qemu/throttle.h
>> +++ b/include/qemu/throttle.h
>> @@ -27,6 +27,7 @@
>>
>> #include "qemu-common.h"
>> #include "qemu/timer.h"
>> +#include "qemu/coroutine.h"
>>
>> #define THROTTLE_VALUE_MAX 1000000000000000LL
>>
>> @@ -153,4 +154,29 @@ bool throttle_schedule_timer(ThrottleState *ts,
>>
>> void throttle_account(ThrottleState *ts, bool is_write, uint64_t size);
>>
>> +
>> +/* The ThrottleGroupMember structure indicates membership in a ThrottleGroup
>> + * and holds related data.
>> + */
>> +
>> +typedef struct ThrottleGroupMember {
>> + /* throttled_reqs_lock protects the CoQueues for throttled requests. */
>> + CoMutex throttled_reqs_lock;
>> + CoQueue throttled_reqs[2];
>> +
>> + /* Nonzero if the I/O limits are currently being ignored; generally
>> + * it is zero. Accessed with atomic operations.
>> + */
>> + unsigned int io_limits_disabled;
>> +
>> + /* The following fields are protected by the ThrottleGroup lock.
>> + * See the ThrottleGroup documentation for details.
>> + * throttle_state tells us if I/O limits are configured. */
>> + ThrottleState *throttle_state;
>> + ThrottleTimers throttle_timers;
>> + unsigned pending_reqs[2];
>> + QLIST_ENTRY(ThrottleGroupMember) round_robin;
>> +
>> +} ThrottleGroupMember;
>> +
>
>Any reason why you add this to throttle.h (which is generic throttling
>code independent from the block layer) and not to throttle-groups.h?
I put it there because it's not directly ThrottleGroup-related, but
you're right, if throttle.h is block layer free it should remain that
way.
>
>Otherwise it all looks good to me, thanks!
>
>Berto
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-06-27 12:25 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 12:46 [Qemu-devel] [PATCH RFC v3 0/8] I/O Throtting block filter driver Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember Manos Pitsidianakis
2017-06-26 13:23 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-27 12:08 ` [Qemu-devel] " Alberto Garcia
2017-06-27 12:24 ` Manos Pitsidianakis [this message]
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember Manos Pitsidianakis
2017-06-26 13:36 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-26 14:03 ` Manos Pitsidianakis
2017-06-27 12:39 ` [Qemu-devel] " Alberto Garcia
2017-06-28 11:27 ` Kevin Wolf
2017-06-28 12:15 ` Manos Pitsidianakis
2017-06-28 12:44 ` Kevin Wolf
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 3/8] block: add throttle block filter driver Manos Pitsidianakis
2017-06-26 14:00 ` [Qemu-devel] [Qemu-block] " Manos Pitsidianakis
2017-06-26 14:30 ` Stefan Hajnoczi
2017-06-26 16:01 ` Manos Pitsidianakis
2017-06-27 12:42 ` Stefan Hajnoczi
2017-06-26 16:26 ` Manos Pitsidianakis
2017-06-27 12:45 ` Stefan Hajnoczi
2017-06-27 13:34 ` Manos Pitsidianakis
2017-06-28 12:11 ` Stefan Hajnoczi
2017-06-26 14:34 ` Stefan Hajnoczi
2017-06-28 14:40 ` [Qemu-devel] " Kevin Wolf
2017-06-28 15:22 ` Manos Pitsidianakis
2017-06-28 15:36 ` Kevin Wolf
2017-06-28 15:50 ` Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM Manos Pitsidianakis
2017-06-26 14:52 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-26 15:24 ` Manos Pitsidianakis
2017-06-27 12:57 ` Stefan Hajnoczi
2017-06-26 16:58 ` Manos Pitsidianakis
2017-06-27 13:02 ` Stefan Hajnoczi
2017-06-27 16:05 ` Alberto Garcia
2017-06-27 16:12 ` Manos Pitsidianakis
2017-06-28 12:07 ` Stefan Hajnoczi
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI Manos Pitsidianakis
2017-06-26 14:55 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-27 13:12 ` [Qemu-devel] " Eric Blake
2017-06-28 13:35 ` Alberto Garcia
2017-06-28 13:42 ` Manos Pitsidianakis
2017-06-28 15:50 ` Kevin Wolf
2017-06-28 16:02 ` Eric Blake
2017-06-28 16:18 ` Kevin Wolf
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver() Manos Pitsidianakis
2017-06-26 15:11 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-28 15:55 ` Kevin Wolf
2017-06-28 13:42 ` [Qemu-devel] " Alberto Garcia
2017-06-28 13:47 ` Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 7/8] block: remove legacy I/O throttling Manos Pitsidianakis
2017-06-26 15:44 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-26 22:45 ` Manos Pitsidianakis
2017-06-27 13:08 ` Stefan Hajnoczi
2017-06-23 12:47 ` [Qemu-devel] [PATCH RFC v3 8/8] block: add throttle block filter driver interface tests Manos Pitsidianakis
2017-06-28 11:18 ` Kevin Wolf
2017-06-26 15:46 ` [Qemu-devel] [Qemu-block] [PATCH RFC v3 0/8] I/O Throtting block filter driver Stefan Hajnoczi
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=20170627122409.2kot2sct56m6mmgg@postretch \
--to=el13635@mail.ntua.gr \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).