All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Shinkevich via <qemu-devel@nongnu.org>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com,
	kwolf@redhat.com, mreitz@redhat.com, armbru@redhat.com,
	jsnow@redhat.com, eblake@redhat.com, den@openvz.org,
	vsementsov@virtuozzo.com, andrey.shinkevich@virtuozzo.com
Subject: [PATCH v12 12/14] copy-on-read: skip non-guest reads if no copy needed
Date: Thu, 22 Oct 2020 21:13:41 +0300	[thread overview]
Message-ID: <1603390423-980205-13-git-send-email-andrey.shinkevich@virtuozzo.com> (raw)
In-Reply-To: <1603390423-980205-1-git-send-email-andrey.shinkevich@virtuozzo.com>

If the flag BDRV_REQ_PREFETCH was set, skip idling read/write
operations in COR-driver. It can be taken into account for the
COR-algorithms optimization. That check is being made during the
block stream job by the moment.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
 block/copy-on-read.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/block/copy-on-read.c b/block/copy-on-read.c
index a2b180a..081e661 100644
--- a/block/copy-on-read.c
+++ b/block/copy-on-read.c
@@ -153,10 +153,14 @@ static int coroutine_fn cor_co_preadv_part(BlockDriverState *bs,
             }
         }
 
-        ret = bdrv_co_preadv_part(bs->file, offset, n, qiov, qiov_offset,
-                                  local_flags);
-        if (ret < 0) {
-            return ret;
+        /* Skip if neither read nor write are needed */
+        if ((local_flags & (BDRV_REQ_PREFETCH | BDRV_REQ_COPY_ON_READ)) !=
+            BDRV_REQ_PREFETCH) {
+            ret = bdrv_co_preadv_part(bs->file, offset, n, qiov, qiov_offset,
+                                      local_flags);
+            if (ret < 0) {
+                return ret;
+            }
         }
 
         offset += n;
-- 
1.8.3.1



  parent reply	other threads:[~2020-10-22 18:33 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 18:13 [PATCH v12 00/14] Apply COR-filter to the block-stream permanently Andrey Shinkevich via
2020-10-22 18:13 ` [PATCH v12 01/14] copy-on-read: support preadv/pwritev_part functions Andrey Shinkevich via
2020-10-22 18:13 ` [PATCH v12 02/14] block: add insert/remove node functions Andrey Shinkevich via
2020-10-23 14:24   ` Vladimir Sementsov-Ogievskiy
2020-10-23 14:32     ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 03/14] copy-on-read: add filter drop function Andrey Shinkevich via
2020-10-23 14:32   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 04/14] qapi: add filter-node-name to block-stream Andrey Shinkevich via
2020-10-22 18:13 ` [PATCH v12 05/14] qapi: create BlockdevOptionsCor structure for COR driver Andrey Shinkevich via
2020-10-23 14:51   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 06/14] copy-on-read: pass bottom node name to " Andrey Shinkevich via
2020-10-23 14:45   ` Vladimir Sementsov-Ogievskiy
2020-10-23 15:31     ` Andrey Shinkevich
2020-10-23 16:01       ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 07/14] copy-on-read: limit COR operations to bottom node Andrey Shinkevich via
2020-10-23 14:59   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 08/14] iotests: add #310 to test bottom node in COR driver Andrey Shinkevich via
2020-10-27 14:23   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 09/14] block: modify the comment for BDRV_REQ_PREFETCH flag Andrey Shinkevich via
2020-10-27 14:44   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 10/14] block: include supported_read_flags into BDS structure Andrey Shinkevich via
2020-10-27 14:50   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 11/14] copy-on-read: add support for read flags to COR-filter Andrey Shinkevich via
2020-10-27 14:46   ` Vladimir Sementsov-Ogievskiy
2020-10-27 14:56     ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` Andrey Shinkevich via [this message]
2020-10-22 18:13 ` [PATCH v12 13/14] stream: skip filters when writing backing file name to QCOW2 header Andrey Shinkevich via
2020-10-27 15:09   ` Vladimir Sementsov-Ogievskiy
2020-10-27 16:01     ` Andrey Shinkevich
2020-10-27 16:21       ` Vladimir Sementsov-Ogievskiy
2020-10-27 16:42         ` Andrey Shinkevich
2020-10-27 16:44           ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 14/14] block: apply COR-filter to block-stream jobs Andrey Shinkevich via
2020-10-27 16:13   ` Vladimir Sementsov-Ogievskiy
2020-10-27 17:48     ` Andrey Shinkevich
2020-10-27 17:57       ` Vladimir Sementsov-Ogievskiy
2020-10-27 18:24         ` Andrey Shinkevich
2020-12-02 18:18           ` Andrey Shinkevich
2020-12-03 19:19             ` Vladimir Sementsov-Ogievskiy

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=1603390423-980205-13-git-send-email-andrey.shinkevich@virtuozzo.com \
    --to=qemu-devel@nongnu.org \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.