qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: mark aio_poll as non-coroutine
@ 2023-09-08  7:54 Paolo Bonzini
  2023-09-10  9:19 ` Michael Tokarev
  2023-09-19 16:01 ` Kevin Wolf
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2023-09-08  7:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, qemu-trivial

It is forbidden to block on the event loop during a coroutine, as that
can cause deadlocks due to recursive locking.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/block/aio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/block/aio.h b/include/block/aio.h
index 32042e8905a..f1d0a37d68f 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -468,7 +468,7 @@ void aio_dispatch(AioContext *ctx);
  * or more AIO events have completed, to ensure something has moved
  * before returning.
  */
-bool aio_poll(AioContext *ctx, bool blocking);
+bool no_coroutine_fn aio_poll(AioContext *ctx, bool blocking);
 
 /* Register a file descriptor and associated callbacks.  Behaves very similarly
  * to qemu_set_fd_handler.  Unlike qemu_set_fd_handler, these callbacks will
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: mark aio_poll as non-coroutine
  2023-09-08  7:54 [PATCH] block: mark aio_poll as non-coroutine Paolo Bonzini
@ 2023-09-10  9:19 ` Michael Tokarev
  2023-09-19 16:01 ` Kevin Wolf
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2023-09-10  9:19 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-block, qemu-trivial

08.09.2023 10:54, Paolo Bonzini wrote:
> It is forbidden to block on the event loop during a coroutine, as that
> can cause deadlocks due to recursive locking.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   include/block/aio.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/block/aio.h b/include/block/aio.h
> index 32042e8905a..f1d0a37d68f 100644
> --- a/include/block/aio.h
> +++ b/include/block/aio.h
> @@ -468,7 +468,7 @@ void aio_dispatch(AioContext *ctx);
>    * or more AIO events have completed, to ensure something has moved
>    * before returning.
>    */
> -bool aio_poll(AioContext *ctx, bool blocking);
> +bool no_coroutine_fn aio_poll(AioContext *ctx, bool blocking);
>   
>   /* Register a file descriptor and associated callbacks.  Behaves very similarly
>    * to qemu_set_fd_handler.  Unlike qemu_set_fd_handler, these callbacks will

Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>

While this is a no-op change for the code and trivial syntactically,
I'm skeptical it should go through trivial-patches@.

/mjt


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: mark aio_poll as non-coroutine
  2023-09-08  7:54 [PATCH] block: mark aio_poll as non-coroutine Paolo Bonzini
  2023-09-10  9:19 ` Michael Tokarev
@ 2023-09-19 16:01 ` Kevin Wolf
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2023-09-19 16:01 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-block, qemu-trivial

Am 08.09.2023 um 09:54 hat Paolo Bonzini geschrieben:
> It is forbidden to block on the event loop during a coroutine, as that
> can cause deadlocks due to recursive locking.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks, applied to the block branch.

Kevin



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-19 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-08  7:54 [PATCH] block: mark aio_poll as non-coroutine Paolo Bonzini
2023-09-10  9:19 ` Michael Tokarev
2023-09-19 16:01 ` Kevin Wolf

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).