[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] block: file-posix: Replace posix_fallocate with fallocat
From: |
Alberto Garcia |
Subject: |
Re: [PATCH 2/2] block: file-posix: Replace posix_fallocate with fallocate |
Date: |
Tue, 01 Sep 2020 17:51:55 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 31 Aug 2020 04:01:27 PM CEST, Nir Soffer wrote:
> If fallocate() is not supported, posix_fallocate() falls back to
> inefficient allocation, writing one byte for every 4k bytes[1]. This is
> very slow compared with writing zeros. In oVirt we measured ~400%
> improvement in allocation time when replacing posix_fallocate() with
> manually writing zeroes[2].
>
> We also know that posix_fallocated() does not work well when using OFD
> locks[3]. We don't know the reason yet for this issue yet.
>
> Change preallocate_falloc() to use fallocate() instead of
> posix_falloate(), and fall back to full preallocation if not
> supported.
> case PREALLOC_MODE_FALLOC:
> result = preallocate_falloc(fd, current_length, offset, errp);
> - goto out;
> + if (result != -ENOTSUP)
> + goto out;
> + /* If fallocate() is not supported, fallback to full preallocation.
> */
With the missing braces in this if statement,
Reviewed-by: Alberto Garcia <berto@igalia.com>
Berto
- Re: [PATCH 2/2] block: file-posix: Replace posix_fallocate with fallocate,
Alberto Garcia <=