qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Kevin Wolf <kwolf@redhat.com>,
	Pavel Butsykin <pbutsykin@virtuozzo.com>,
	Jeff Cody <jcody@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for 2.7 0/2] backup compression
Date: Wed, 27 Apr 2016 15:59:10 +0800	[thread overview]
Message-ID: <20160427075910.GA1421@ad.usersys.redhat.com> (raw)
In-Reply-To: <57205CE2.4070009@openvz.org>

On Wed, 04/27 09:32, Denis V. Lunev wrote:
> On 04/26/2016 12:46 PM, Stefan Hajnoczi wrote:
> > On Sat, Apr 23, 2016 at 11:41:51AM +0300, Denis V. Lunev wrote:
> > > The idea is simple - backup is "written-once" data. It is written block
> > > by block and it is large enough. It would be nice to save storage
> > > space and compress it.
> > > 
> > > These patches add the ability to compress data during backup. This
> > > functionality is implemented by means of adding options to the qmp/hmp
> > > commands(drive-backup, blockdev-backup). The implementation is quite
> > > simple, because the responsibility for data compression imposed on the
> > > format driver.
> > > 
> > > Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> > > Signed-off-by: Denis V. Lunev <den@openvz.org>
> > > CC: Jeff Cody <jcody@redhat.com>
> > > CC: Markus Armbruster <armbru@redhat.com>
> > > CC: Eric Blake <eblake@redhat.com>
> > > CC: John Snow <jsnow@redhat.com>
> > > 
> > > Pavel Butsykin (2):
> > >    drive-backup: added support for data compression
> > >    blockdev-backup: added support for data compression
> > > 
> > >   block/backup.c            | 13 +++++++++++++
> > >   blockdev.c                | 20 ++++++++++++++++++--
> > >   hmp-commands.hx           |  8 +++++---
> > >   hmp.c                     |  3 ++-
> > >   include/block/block_int.h |  1 +
> > >   qapi/block-core.json      |  3 ++-
> > >   qmp-commands.hx           |  7 +++++--
> > >   7 files changed, 46 insertions(+), 9 deletions(-)
> > bdrv_write_compressed() hasn't been called from a running VM before, it
> > was purely a synchronous qemu-img operation.  The
> > qcow2.c:qcow2_write_compressed() code doesn't seem to be written with
> > coroutine context in mind but I think the lock in
> > block/backup.c:backup_do_cow() will protect against race conditions.
> > 
> > Please include a test case (using qcow2?).
> I have looked into the code. The only problematic thing there
> is that the compression is performed directly in the write,
> which could take a bit of time.
> 
> Thus responsiveness of the guest system could be reduced.
> Though I do not expect here troubles. I think that it is worth
> to give this tech a chance. Compression could be moved to
> the outer thread in the next step if required.

As far as I can tell, in order to be used in a coroutine, we need a
"qemu_co_mutex_lock(&s->lock);" pair in vmdk_write_compressed. Something
similar probably apply to qcow2 as well.

Maybe what we should do is adding a bdrv_co_write_compressed().

Fam

  reply	other threads:[~2016-04-27  7:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23  8:41 [Qemu-devel] [PATCH for 2.7 0/2] backup compression Denis V. Lunev
2016-04-23  8:41 ` [Qemu-devel] [PATCH 1/2] drive-backup: added support for data compression Denis V. Lunev
2016-04-23  8:41 ` [Qemu-devel] [PATCH 2/2] blockdev-backup: " Denis V. Lunev
2016-04-26  9:46 ` [Qemu-devel] [PATCH for 2.7 0/2] backup compression Stefan Hajnoczi
2016-04-27  6:32   ` Denis V. Lunev
2016-04-27  7:59     ` Fam Zheng [this message]
2016-04-27  8:15       ` Denis V. Lunev
2016-04-27  8:15       ` Kevin Wolf

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=20160427075910.GA1421@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbutsykin@virtuozzo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).