All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"John Snow" <jsnow@redhat.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	qemu-block@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Fam Zheng" <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Greg Kurz" <groug@kaod.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Anthony PERARD" <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org,
	"Li Zhijian" <lizhijian@fujitsu.com>
Subject: Re: [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel()
Date: Mon, 20 Jul 2026 10:13:03 -0400	[thread overview]
Message-ID: <al4s77A0rlX0_PQc@x1.local> (raw)
In-Reply-To: <20260720-co-v1-8-fabb4db3c204@redhat.com>

On Mon, Jul 20, 2026 at 11:55:37AM +0400, Marc-André Lureau wrote:
> The function calls yield_until_fd_readable() (coroutine_fn) when in
> coroutine context, and polls with qemu_poll_ns() otherwise.
> 
> Replace the migration-state proxy check with qemu_in_coroutine(),
> which directly tests what matters.
> 
> Fixes: 2da776db4846 ("rdma: core logic")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

Just to say we can also drop the var.  I have a patch did it already but I
didn't get chance to revisit the series:

https://lore.kernel.org/qemu-devel/20251022192612.2737648-5-peterx@redhat.com/

So we can also pick that single patch up, then this patch can be
annotation-only.  I'll leave it to you.

Thanks,

> ---
>  migration/rdma.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 3e37a1d4401..438419d1894 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -1348,17 +1348,13 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct ibv_cq *cq,
>  /* Wait for activity on the completion channel.
>   * Returns 0 on success, none-0 on error.
>   */
> -static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
> -                                       struct ibv_comp_channel *comp_channel)
> +static int coroutine_mixed_fn
> +qemu_rdma_wait_comp_channel(RDMAContext *rdma,
> +                            struct ibv_comp_channel *comp_channel)
>  {
>      struct rdma_cm_event *cm_event;
>  
> -    /*
> -     * Coroutine doesn't start until migration_fd_process_incoming()
> -     * so don't yield unless we know we're running inside of a coroutine.
> -     */
> -    if (rdma->migration_started_on_destination &&
> -        migration_incoming_get_current()->state == MIGRATION_STATUS_ACTIVE) {
> +    if (qemu_in_coroutine()) {
>          yield_until_fd_readable(comp_channel->fd);
>      } else {
>          /* This is the source side, we're in a separate thread
> 
> -- 
> 2.55.0
> 

-- 
Peter Xu



      reply	other threads:[~2026-07-20 14:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  7:55 [PATCH 0/8] coroutine: add missing annotations Marc-André Lureau
2026-07-20  7:55 ` [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine Marc-André Lureau
2026-07-20 12:34   ` Markus Armbruster
2026-07-20 14:26   ` Philippe Mathieu-Daudé
2026-07-20  7:55 ` [PATCH 2/8] migration: fix qemu_get_counted_string annotation Marc-André Lureau
2026-07-20 14:09   ` Peter Xu
2026-07-20 14:27   ` Philippe Mathieu-Daudé
2026-07-20  7:55 ` [PATCH 3/8] io: add missing coroutine annotation Marc-André Lureau
2026-07-20 14:28   ` Philippe Mathieu-Daudé
2026-07-20  7:55 ` [PATCH 4/8] block: " Marc-André Lureau
2026-07-20 14:28   ` Philippe Mathieu-Daudé
2026-07-20  7:55 ` [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls Marc-André Lureau
2026-07-20 20:57   ` Philippe Mathieu-Daudé
2026-07-20  7:55 ` [PATCH 6/8] block: add missing coroutine_fn annotations Marc-André Lureau
2026-07-20 20:58   ` Philippe Mathieu-Daudé
2026-07-20  7:55 ` [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn Marc-André Lureau
2026-07-20 14:02   ` Christian Schoenebeck
2026-07-20 20:42     ` Philippe Mathieu-Daudé
2026-07-20 20:54       ` Philippe Mathieu-Daudé
2026-07-21  7:58         ` Marc-André Lureau
2026-07-21  8:06           ` Marc-André Lureau
2026-07-21  8:25             ` Philippe Mathieu-Daudé
2026-07-21  8:37               ` Christian Schoenebeck
2026-07-21  8:39                 ` Marc-André Lureau
2026-07-21  8:50                   ` Christian Schoenebeck
2026-07-20  7:55 ` [PATCH 8/8] migration/rdma: annotate and simplify wait_comp_channel() Marc-André Lureau
2026-07-20 14:13   ` Peter Xu [this message]

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=al4s77A0rlX0_PQc@x1.local \
    --to=peterx@redhat.com \
    --cc=anthony@xenproject.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=den@openvz.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=fam@euphon.net \
    --cc=farosas@suse.de \
    --cc=groug@kaod.org \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lizhijian@fujitsu.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    --cc=xen-devel@lists.xenproject.org \
    /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.