yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-aio-posix-Don-t-count-ctx-notifier-as-progress-when-.patch

ae23c9
From 84935bf2482b06b983ccdb953b2cc90960d2ab16 Mon Sep 17 00:00:00 2001
ae23c9
From: Fam Zheng <famz@redhat.com>
ae23c9
Date: Tue, 9 Oct 2018 08:16:47 +0100
ae23c9
Subject: [PATCH 03/17] aio-posix: Don't count ctx->notifier as progress when
ae23c9
 polling
ae23c9
ae23c9
RH-Author: Fam Zheng <famz@redhat.com>
ae23c9
Message-id: <20181009081651.15463-2-famz@redhat.com>
ae23c9
Patchwork-id: 82454
ae23c9
O-Subject: [RHEL8/rhel qemu-kvm PATCH 1/5] aio-posix: Don't count ctx->notifier as progress when polling
ae23c9
Bugzilla: 1623085
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ae23c9
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
ae23c9
ae23c9
BZ: 1623085
ae23c9
ae23c9
The same logic exists in fd polling. This change is especially important
ae23c9
to avoid busy loop once we limit aio_notify_accept() to blocking
ae23c9
aio_poll().
ae23c9
ae23c9
Cc: qemu-stable@nongnu.org
ae23c9
Signed-off-by: Fam Zheng <famz@redhat.com>
ae23c9
Message-Id: <20180809132259.18402-2-famz@redhat.com>
ae23c9
Signed-off-by: Fam Zheng <famz@redhat.com>
ae23c9
(cherry picked from commit 70232b5253a3c4e03ed1ac47ef9246a8ac66c6fa)
ae23c9
Signed-off-by: Fam Zheng <famz@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 util/aio-posix.c | 3 ++-
ae23c9
 1 file changed, 2 insertions(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/util/aio-posix.c b/util/aio-posix.c
ae23c9
index d8f0cb4..f650c7c 100644
ae23c9
--- a/util/aio-posix.c
ae23c9
+++ b/util/aio-posix.c
ae23c9
@@ -494,7 +494,8 @@ static bool run_poll_handlers_once(AioContext *ctx)
ae23c9
     QLIST_FOREACH_RCU(node, &ctx->aio_handlers, node) {
ae23c9
         if (!node->deleted && node->io_poll &&
ae23c9
             aio_node_check(ctx, node->is_external) &&
ae23c9
-            node->io_poll(node->opaque)) {
ae23c9
+            node->io_poll(node->opaque) &&
ae23c9
+            node->opaque != &ctx->notifier) {
ae23c9
             progress = true;
ae23c9
         }
ae23c9
 
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9