cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-block-write-Handle-COR-dependency-after-I-O-throttli.patch

9ae3a8
From b66f204fcdb797b85050f3f6af6b4967247fd0f5 Mon Sep 17 00:00:00 2001
9ae3a8
From: Kevin Wolf <kwolf@redhat.com>
9ae3a8
Date: Tue, 3 Dec 2013 14:30:44 +0100
9ae3a8
Subject: [PATCH 14/37] block: write: Handle COR dependency after I/O throttling
9ae3a8
9ae3a8
Message-id: <1392117622-28812-15-git-send-email-kwolf@redhat.com>
9ae3a8
Patchwork-id: 57179
9ae3a8
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 14/37] block: write: Handle COR dependency after I/O throttling
9ae3a8
Bugzilla: 748906
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Max Reitz <mreitz@redhat.com>
9ae3a8
9ae3a8
First waiting for all COR requests to complete and calling the
9ae3a8
throttling function afterwards means that the request could be delayed
9ae3a8
and we still need to wait for the COR request even if it was issued only
9ae3a8
after the throttled write request.
9ae3a8
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
Reviewed-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Reviewed-by: Benoit Canet <benoit@irqsave.net>
9ae3a8
(cherry picked from commit 244eadef5c797c674b0aef96366671be4b33d03a)
9ae3a8
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
---
9ae3a8
 block.c | 8 ++++----
9ae3a8
 1 file changed, 4 insertions(+), 4 deletions(-)
9ae3a8
---
9ae3a8
 block.c |    8 ++++----
9ae3a8
 1 files changed, 4 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
diff --git a/block.c b/block.c
9ae3a8
index e6b6ed4..d8168f5 100644
9ae3a8
--- a/block.c
9ae3a8
+++ b/block.c
9ae3a8
@@ -2997,6 +2997,10 @@ static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs,
9ae3a8
     assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0);
9ae3a8
     assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
9ae3a8
 
9ae3a8
+    if (bs->copy_on_read_in_flight) {
9ae3a8
+        wait_for_overlapping_requests(bs, sector_num, nb_sectors);
9ae3a8
+    }
9ae3a8
+
9ae3a8
     tracked_request_begin(&req, bs, sector_num, nb_sectors, true);
9ae3a8
 
9ae3a8
     if (flags & BDRV_REQ_ZERO_WRITE) {
9ae3a8
@@ -3044,10 +3048,6 @@ static int coroutine_fn bdrv_co_do_writev(BlockDriverState *bs,
9ae3a8
         return -EIO;
9ae3a8
     }
9ae3a8
 
9ae3a8
-    if (bs->copy_on_read_in_flight) {
9ae3a8
-        wait_for_overlapping_requests(bs, sector_num, nb_sectors);
9ae3a8
-    }
9ae3a8
-
9ae3a8
     /* throttling disk I/O */
9ae3a8
     if (bs->io_limits_enabled) {
9ae3a8
         bdrv_io_limits_intercept(bs, true, nb_sectors);
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8