[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster
From: |
Alberto Garcia |
Subject: |
Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster |
Date: |
Wed, 19 Aug 2020 16:25:16 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 17 Aug 2020 05:53:07 PM CEST, Kevin Wolf wrote:
>> > Or are you saying that ZERO_RANGE + pwrite on a sparse file (=
>> > cluster allocation) is faster for you than just the pwrite alone (=
>> > writing to already allocated cluster)?
>>
>> Yes, 20% faster in my tests (4KB random writes), but in the latter
>> case the cluster is already allocated only at the qcow2 level, not on
>> the filesystem. preallocation=falloc is faster than
>> preallocation=metadata (preallocation=off sits in the middle).
>
> Hm, this feels wrong. Doing more operations should never be faster
> than doing less operations.
>
> Maybe the difference is in allocating 64k at once instead of doing a
> separate allocation for every 4k block? But with the extent size hint
> patches to file-posix, we should allocate 1 MB at once by default now
> (if your test image was newly created). Can you check whether this is
> in effect for your image file?
I checked with xfs on my computer. I'm not very familiar with that
filesystem so I was using the default options and I didn't tune
anything.
What I got with my tests (using fio):
- Using extent_size_hint didn't make any difference in my test case (I
do see a clear difference however with the test case described in
commit ffa244c84a).
- preallocation=off is still faster than preallocation=metadata. If I
disable handle_alloc_space() (so there is no ZERO_RANGE used) then it
is much slower.
- With preallocation=falloc I get the same results as with
preallocation=metadata.
- preallocation=full is the fastest by far.
Berto
- [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Alberto Garcia, 2020/08/14
- [PATCH 1/1] qcow2: Skip copy-on-write when allocating a zero cluster, Alberto Garcia, 2020/08/14
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Vladimir Sementsov-Ogievskiy, 2020/08/14
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Kevin Wolf, 2020/08/17
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Brian Foster, 2020/08/19
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Alberto Garcia, 2020/08/20
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Dave Chinner, 2020/08/20
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Brian Foster, 2020/08/21
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Alberto Garcia, 2020/08/21
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Alberto Garcia, 2020/08/21
- Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster, Brian Foster, 2020/08/21