All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes
Date: Sun, 23 Feb 2014 20:10:22 +0100	[thread overview]
Message-ID: <530A479E.4070900@kamp.de> (raw)
In-Reply-To: <20140222164512.GC16767@T430.redhat.com>

Am 22.02.2014 17:45, schrieb Fam Zheng:
> On Sat, 02/22 14:00, Peter Lieven wrote:
>> this patch tries to optimize zero write requests
>> by automatically using bdrv_write_zeroes if it is
>> supported by the format.
>>
>> i know that there is a lot of potential for discussion, but i would
>> like to know what the others think.
>>
>> this should significantly speed up file system initialization and
>> should speed zero write test used to test backend storage performance.
>>
>> the difference can simply be tested by e.g.
>>
>> dd if=/dev/zero of=/dev/vdX bs=1M
>>
>> Signed-off-by: Peter Lieven <pl@kamp.de>
>> ---
> With this patch, is is still possible to actually do zero fill? Prefill is
> usually writing zeroes too, but according to the semantic, bdrv_write_zeroes
> may just set L2 entry flag without allocating clusters, which won't satisfy
> that.
Can you specify which operation you exactly mean? I don't think that
there is a problem, but maybe it would be better to add a check for
bs->file != NULL so the optimization takes only place for the format
not for the protocol.

I meanwhile ran a short test which shows that there is potential for significant
improvement.

I created a 60GB qcow2 container and formatted it with ext4. To immediately show the difference
I disabled lazy inode table and lazy journal init (writing zero takes place immediately then).

Timing without the patch:
time mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/vda
real 1m5.649s
user 0m0.416s
sys  0m3.148s

Timing with the patch:
time mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/vdX
real 0m1.228s
user 0m0.116s
sys  0m0.732s

Container Size after Format without the patch: 1150615552 Byte (1097.3MB)
Container Size after Format with the patch: 24645632 Byte (23.5MB)

Peter


>
> Thanks,
> Fam

  reply	other threads:[~2014-02-23 19:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 13:00 [Qemu-devel] [RFC PATCH] block: optimize zero writes with bdrv_write_zeroes Peter Lieven
2014-02-22 16:45 ` Fam Zheng
2014-02-23 19:10   ` Peter Lieven [this message]
2014-02-24  1:01     ` Fam Zheng
2014-02-24 10:39       ` Paolo Bonzini
2014-02-24 11:33         ` Fam Zheng
2014-02-24 11:51           ` Paolo Bonzini
2014-02-24 12:04             ` Fam Zheng
2014-02-24 12:07             ` Kevin Wolf
2014-02-24 12:10               ` Paolo Bonzini
2014-02-24 12:22                 ` Kevin Wolf
2014-02-24 10:11 ` Kevin Wolf
2014-02-24 10:26   ` Peter Lieven
2014-02-24 10:38     ` Paolo Bonzini
2014-02-24 11:50       ` Peter Lieven
2014-02-24 13:01       ` Peter Lieven
2014-02-25 13:41         ` Kevin Wolf
2014-02-25 17:03           ` Peter Lieven

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=530A479E.4070900@kamp.de \
    --to=pl@kamp.de \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.