All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"kwolf@redhat.com" <kwolf@redhat.com>,
	"mreitz@redhat.com" <mreitz@redhat.com>,
	"eblake@redhat.com" <eblake@redhat.com>,
	Denis Lunev <den@virtuozzo.com>,
	"berto@igalia.com" <berto@igalia.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Subject: Re: [Qemu-devel] [PATCH v12 00/10] qcow2: cluster space preallocation
Date: Thu, 21 Feb 2019 08:05:13 +0000	[thread overview]
Message-ID: <aad71cef-0a47-c826-2d4b-891f2f1285f7@virtuozzo.com> (raw)
In-Reply-To: <20190114111744.113188-1-anton.nefedov@virtuozzo.com>

On 14/1/2019 2:18 PM, Anton Nefedov wrote:
> This pull request is to start to improve a few performance points of
> qcow2 format:
> 
>    1. non cluster-aligned write requests (to unallocated clusters) explicitly
>       pad data with zeroes if there is no backing data.
>       Resulting increase in ops number and potential cluster fragmentation
>       (on the host file) is already solved by:
>         ee22a9d qcow2: Merge the writing of the COW regions with the guest data
>       However, in case of zero COW regions, that can be avoided at all
>       but the whole clusters are preallocated and zeroed in a single
>       efficient write_zeroes() operation
> 
>    2. moreover, efficient write_zeroes() operation can be used to preallocate
>       space megabytes (*configurable number) ahead which gives noticeable
>       improvement on some storage types (e.g. distributed storage)
>       where the space allocation operation might be expensive)
>       (Not included in this patchset since v6).
> 
>    3. this will also allow to enable simultaneous writes to the same unallocated
>       cluster after the space has been allocated & zeroed but before
>       the first data is written and the cluster is linked to L2.
>       (Not included in this patchset).
> 
> Efficient write_zeroes usually implies that the blocks are not actually
> written to but only reserved and marked as zeroed by the storage.
> In this patchset, file-posix driver is marked as supporting this operation
> if it supports (/configured to support) fallocate() operation.
> 
> Existing bdrv_write_zeroes() falls back to writing zero buffers if
> write_zeroes is not supported by the driver.
> A new flag (BDRV_REQ_ALLOCATE) is introduced to avoid that but return ENOTSUP.
> Such allocate requests are also implemented to possibly overlap with the
> other requests. No wait is performed but an error returned in such case as well.
> So the operation should be considered advisory and a fallback scenario still
> handled by the caller (in this case, qcow2 driver).
> 
> simple perf test:
> 
>    qemu-img create -f qcow2 test.img 4G && \
>    qemu-img bench -c $((1024*1024)) -f qcow2 -n -s 4k -t none -w test.img
> 
> test results (seconds):
> 
>      +-----------+-------+------+-------+------+------+
>      |   file    |    before    |     after    | gain |
>      +-----------+-------+------+-------+------+------+
>      |    ssd    |      61.153  |      36.313  |  41% |
>      |    hdd    |     112.676  |     122.056  |  -8% |
>      +-----------+--------------+--------------+------+
> 

ping

      parent reply	other threads:[~2019-02-21  8:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 11:18 [Qemu-devel] [PATCH v12 00/10] qcow2: cluster space preallocation Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 02/10] blkverify: set supported write/zero flags Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 01/10] mirror: inherit " Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 03/10] quorum: set supported write flags Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 05/10] block: treat BDRV_REQ_ALLOCATE as serialising Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 04/10] block: introduce BDRV_REQ_ALLOCATE flag Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 06/10] file-posix: reset fallocate-related flags without CONFIG_FALLOCATE* Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 07/10] file-posix: support BDRV_REQ_ALLOCATE Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 08/10] block: support BDRV_REQ_ALLOCATE in passthrough drivers Anton Nefedov
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 09/10] qcow2: skip writing zero buffers to empty COW areas Anton Nefedov
2019-01-15 15:27   ` Alberto Garcia
2019-01-16  9:32     ` Anton Nefedov
2019-01-16  9:35       ` Alberto Garcia
2019-01-14 11:18 ` [Qemu-devel] [PATCH v12 10/10] iotest 134: test cluster-misaligned encrypted write Anton Nefedov
2019-02-21  8:05 ` Anton Nefedov [this message]

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=aad71cef-0a47-c826-2d4b-891f2f1285f7@virtuozzo.com \
    --to=anton.nefedov@virtuozzo.com \
    --cc=berto@igalia.com \
    --cc=den@virtuozzo.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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.