From: Eric Blake <eblake@redhat.com>
To: Qingshu Chen <qingshu.chen714@gmail.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] ignore bdrv_flush operation when no qcow2 cache item is dirty
Date: Mon, 20 Jul 2015 09:03:05 -0600 [thread overview]
Message-ID: <55AD0DA9.20606@redhat.com> (raw)
In-Reply-To: <CANY5aGZc=-XsFasTB3-MiF-Vtof6ZLGsLYY0cSqir0MUC+X1Hg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
[patches should always be sent to qemu-devel, even if qemu-block is also
in the to/cc list]
On 07/08/2015 01:26 AM, Qingshu Chen wrote:
> qcow2_cache_flush() writes dirty cache to the disk and invokes bdrv_flush()
> to make the data durable. But even if there is no dirty cache,
> qcow2_cache_flush() would invoke bdrv_flush(). In fact, bdrv_flush() will
> invoke fdatasync(), and it is an expensive operation. The patch will not
> invoke bdrv_flush if there is not dirty cache. The reason that I modify the
> return value of qcow2_cache_flush() is qcow2_co_flush_to_os needs to know
> whether flush operation is called. Following is the patch:
>
>>From 23f9f83da4178e8fbb53d2cffe128f5a2d3a239a Mon Sep 17 00:00:00 2001
> From: Qingshu Chen <qingshu.chen714@gmail.com>
> Date: Wed, 1 Jul 2015 14:45:23 +0800
> Subject: [PATCH 1/2] ignore bdrv_flush operation when no qcow2 cache item is
> dirty
> Signed-off-by: Qingshu Chen <qingshu.chen714@gmail.com>
I didn't quickly find an associated 2/2 patch; are you sure you sent the
series correctly?
>
> ---
> block/qcow2-cache.c | 9 ++++++++-
> block/qcow2.c | 2 ++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
> index ed92a09..57c0601 100644
> --- a/block/qcow2-cache.c
> +++ b/block/qcow2-cache.c
> @@ -174,6 +174,7 @@ int qcow2_cache_flush(BlockDriverState *bs, Qcow2Cache
> *c)
> int result = 0;
> int ret;
> int i;
> + int flag = 0;
This is used as a bool, so declare it as such (bool flag = false;).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next parent reply other threads:[~2015-07-20 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANY5aGZc=-XsFasTB3-MiF-Vtof6ZLGsLYY0cSqir0MUC+X1Hg@mail.gmail.com>
2015-07-20 15:03 ` Eric Blake [this message]
2015-07-21 1:51 ` [Qemu-devel] [Qemu-block] [PATCH 1/2] ignore bdrv_flush operation when no qcow2 cache item is dirty Qingshu Chen
2015-07-21 12:46 ` Eric Blake
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=55AD0DA9.20606@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qingshu.chen714@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).