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

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