qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, hreitz@redhat.com, kwolf@redhat.com,
	f.ebner@proxmox.com
Subject: [PATCH 1/3] aio-posix: disable polling after aio_disable_external()
Date: Wed,  5 Apr 2023 18:17:50 +0200	[thread overview]
Message-ID: <20230405161752.194727-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20230405161752.194727-1-pbonzini@redhat.com>

Polling can cause external requests to be picked up even if the AioContext
is not looking at external file descriptors.  Disable all polling between
aio_disable_external() and aio_enable_external(), since aio_set_fd_poll()
does not distinguish external handlers from those that in principle could
run.

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

diff --git a/util/aio-posix.c b/util/aio-posix.c
index a8be940f760d..0d22e3d6d37c 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -29,7 +29,7 @@
 
 bool aio_poll_disabled(AioContext *ctx)
 {
-    return qatomic_read(&ctx->poll_disable_cnt);
+    return qatomic_read(&ctx->poll_disable_cnt) || qatomic_read(&ctx->external_disable_cnt);
 }
 
 void aio_add_ready_handler(AioHandlerList *ready_list,
-- 
2.39.2



  reply	other threads:[~2023-04-05 16:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 16:17 [PATCH 0/3] block-backend: avoid deadlocks due to early queuing of request Paolo Bonzini
2023-04-05 16:17 ` Paolo Bonzini [this message]
2023-04-05 16:17 ` [PATCH 2/3] block-backend: make global properties write-once Paolo Bonzini
2023-04-05 16:30 ` [PATCH] block-backend: delay application of request queuing Paolo Bonzini
2023-04-05 16:31 ` [PATCH 3/3] " Paolo Bonzini
2023-04-12 11:54   ` Hanna Czenczek
2023-04-12 12:03     ` Paolo Bonzini
2023-04-12 14:33       ` Hanna Czenczek

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=20230405161752.194727-2-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=f.ebner@proxmox.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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 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).