On Sun, Jun 15, 2014 at 5:17 PM, Russell Coker <russell@xxxxxxxxxxxx> wrote:
> I just did some tests using fallocate(1). I did the tests both with and
> without the -n option which appeared to make no difference.
>
> I started by allocating a 24G file on a 106G filesystem that had 30G free
> according to df. The first time that took almost 2 minutes of system CPU time
> on a Q8400 CPU.
Why does it take 2 minutes? On XFS or ext4, fallocate is almost
instantaneous, even for multi-Terabyte allocations.
According the fallocate man page, preallocation should be quick and
require no IO:
" fallocate is used to manipulate the allocated disk space for a file,
either to deallocate or preallocate it. For filesystems which support
the fallocate system call, preallocation is done quickly by allocating
blocks and marking them as uninitialized, requiring no IO to the data
blocks. This is much faster than creating a file by filling it with
zeros."
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html