|
|
1be5c7 |
From 99d33621440fd30e0da2974dafb0cd372334305a Mon Sep 17 00:00:00 2001
|
|
|
1be5c7 |
From: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
1be5c7 |
Date: Thu, 9 Jun 2022 17:47:12 +0100
|
|
|
1be5c7 |
Subject: [PATCH 2/2] linux-aio: explain why max batch is checked in
|
|
|
1be5c7 |
laio_io_unplug()
|
|
|
1be5c7 |
|
|
|
1be5c7 |
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
1be5c7 |
RH-MergeRequest: 199: linux-aio: fix unbalanced plugged counter in laio_io_unplug()
|
|
|
1be5c7 |
RH-Commit: [2/2] 8617870ed70e3a57269f06eeb242d0fab79a66fb
|
|
|
1be5c7 |
RH-Bugzilla: 2105410
|
|
|
1be5c7 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
1be5c7 |
RH-Acked-by: Hanna Reitz <hreitz@redhat.com>
|
|
|
1be5c7 |
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
1be5c7 |
|
|
|
1be5c7 |
It may not be obvious why laio_io_unplug() checks max batch. I discussed
|
|
|
1be5c7 |
this with Stefano and have added a comment summarizing the reason.
|
|
|
1be5c7 |
|
|
|
1be5c7 |
Cc: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
1be5c7 |
Cc: Kevin Wolf <kwolf@redhat.com>
|
|
|
1be5c7 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
1be5c7 |
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
1be5c7 |
Message-id: 20220609164712.1539045-3-stefanha@redhat.com
|
|
|
1be5c7 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
1be5c7 |
(cherry picked from commit 99b969fbe105117f5af6060d3afef40ca39cc9c1)
|
|
|
1be5c7 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
1be5c7 |
---
|
|
|
1be5c7 |
block/linux-aio.c | 6 ++++++
|
|
|
1be5c7 |
1 file changed, 6 insertions(+)
|
|
|
1be5c7 |
|
|
|
1be5c7 |
diff --git a/block/linux-aio.c b/block/linux-aio.c
|
|
|
1be5c7 |
index 77f17ad596..85650c4222 100644
|
|
|
1be5c7 |
--- a/block/linux-aio.c
|
|
|
1be5c7 |
+++ b/block/linux-aio.c
|
|
|
1be5c7 |
@@ -362,6 +362,12 @@ void laio_io_unplug(BlockDriverState *bs, LinuxAioState *s,
|
|
|
1be5c7 |
assert(s->io_q.plugged);
|
|
|
1be5c7 |
s->io_q.plugged--;
|
|
|
1be5c7 |
|
|
|
1be5c7 |
+ /*
|
|
|
1be5c7 |
+ * Why max batch checking is performed here:
|
|
|
1be5c7 |
+ * Another BDS may have queued requests with a higher dev_max_batch and
|
|
|
1be5c7 |
+ * therefore in_queue could now exceed our dev_max_batch. Re-check the max
|
|
|
1be5c7 |
+ * batch so we can honor our device's dev_max_batch.
|
|
|
1be5c7 |
+ */
|
|
|
1be5c7 |
if (s->io_q.in_queue >= laio_max_batch(s, dev_max_batch) ||
|
|
|
1be5c7 |
(!s->io_q.plugged &&
|
|
|
1be5c7 |
!s->io_q.blocked && !QSIMPLEQ_EMPTY(&s->io_q.pending))) {
|
|
|
1be5c7 |
--
|
|
|
1be5c7 |
2.35.3
|
|
|
1be5c7 |
|