All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Cc: qemu-block@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Markus Armbruster <armbru@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 04/11] bdrv_child_try_change_aio_context: add transaction parameter
Date: Fri, 7 Oct 2022 18:10:35 +0200	[thread overview]
Message-ID: <Y0BPe6+f/db7hvnt@redhat.com> (raw)
In-Reply-To: <20220725122120.309236-5-eesposit@redhat.com>

Am 25.07.2022 um 14:21 hat Emanuele Giuseppe Esposito geschrieben:
> This enables the caller to use the same transaction to also
> keep track of aiocontext changes.
> 
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>

What you're really doing here is factoring out the recursive phase.
However, the factored out function is never used from anywhere else,
so I don't understand the purpose of this patch. It feels like an
unnecessary complication of the code.

The commit message is unclear to me, too: Who is the caller of
bdrv_child_try_change_aio_context() that it mentions, and why does it
make a difference to it how the code is organised internally?

Is this some artifact of changes you made and we don't need it any more
now?

>  block.c                            | 31 ++++++++++++++++++++++++------
>  include/block/block-global-state.h |  5 +++++
>  2 files changed, 30 insertions(+), 6 deletions(-)
> 
> diff --git a/block.c b/block.c
> index c02a628336..221bf90268 100644
> --- a/block.c
> +++ b/block.c
> @@ -7643,17 +7643,16 @@ int bdrv_child_try_set_aio_context(BlockDriverState *bs, AioContext *ctx,
>   * For the same reason, it temporarily holds also the new AioContext, since
>   * bdrv_drained_end calls BDRV_POLL_WHILE that assumes the lock is taken too.
>   */
> -int bdrv_child_try_change_aio_context(BlockDriverState *bs, AioContext *ctx,
> -                                      BdrvChild *ignore_child, Error **errp)
> +int bdrv_child_try_change_aio_context_tran(BlockDriverState *bs,
> +                                           AioContext *ctx,
> +                                           BdrvChild *ignore_child,
> +                                           Transaction *tran,
> +                                           Error **errp)

As mentioned above, this is never used anywhere else than from
bdrv_child_try_change_aio_context(), so if we want to keep the patch, it
should be static at least.

Maybe find a better name, too, because all of the transaction related
operations are in the caller.

The function comment is not accurate any more either because it
described the whole of bdrv_child_try_change_aio_context(), while this
function only contains the recursive part.

Kevin



  reply	other threads:[~2022-10-07 16:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 12:21 [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions Emanuele Giuseppe Esposito
2022-07-25 12:21 ` [PATCH v2 01/11] block.c: assert bs->aio_context is written under BQL and drains Emanuele Giuseppe Esposito
2022-10-07 14:42   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 02/11] block: use transactions as a replacement of ->{can_}set_aio_context() Emanuele Giuseppe Esposito
2022-10-07 15:49   ` Kevin Wolf
2022-10-24 14:44     ` Emanuele Giuseppe Esposito
2022-07-25 12:21 ` [PATCH v2 03/11] bdrv_change_aio_context: use hash table instead of list of visited nodes Emanuele Giuseppe Esposito
2022-10-07 15:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 04/11] bdrv_child_try_change_aio_context: add transaction parameter Emanuele Giuseppe Esposito
2022-10-07 16:10   ` Kevin Wolf [this message]
2022-10-24 14:52     ` Emanuele Giuseppe Esposito
2022-07-25 12:21 ` [PATCH v2 05/11] blockjob: implement .change_aio_ctx in child_job Emanuele Giuseppe Esposito
2022-10-10 10:46   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 06/11] block: implement .change_aio_ctx in child_of_bds Emanuele Giuseppe Esposito
2022-10-10 10:47   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 07/11] block-backend: implement .change_aio_ctx in child_root Emanuele Giuseppe Esposito
2022-10-10 10:50   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 08/11] block: use the new _change_ API instead of _can_set_ and _set_ Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 09/11] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 10/11] block: rename bdrv_child_try_change_aio_context in bdrv_try_change_aio_context Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-25 12:21 ` [PATCH v2 11/11] block: remove bdrv_try_set_aio_context and replace it with bdrv_try_change_aio_context Emanuele Giuseppe Esposito
2022-10-10 12:56   ` Kevin Wolf
2022-07-26 14:24 ` [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions Vladimir Sementsov-Ogievskiy
2022-07-26 14:27   ` Emanuele Giuseppe Esposito
2022-07-27 16:13 ` Vladimir Sementsov-Ogievskiy
2022-08-05 13:22   ` Emanuele Giuseppe Esposito
2022-08-05 13:36     ` Emanuele Giuseppe Esposito
2022-08-05 14:41       ` Vladimir Sementsov-Ogievskiy
2022-08-05 14:35     ` Vladimir Sementsov-Ogievskiy
2022-08-05 14:57       ` Emanuele Giuseppe Esposito
2022-08-06 15:32         ` Vladimir Sementsov-Ogievskiy
2022-08-10 10:22           ` Paolo Bonzini

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=Y0BPe6+f/db7hvnt@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eesposit@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.