Re: question about file space preallocation with fallocate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/27/2010 06:47 AM, Filipe David Manana wrote:
Hi,

I have been playing around with fallocate to preallocate space for a
file with the mode FALLOC_FL_KEEP_SIZE.
I'm running with Linux kernel 2.6.35-24 and ext4 as the fs.

I'm allocating 1Gb for a newly created file and then in a loop I write
1Gb of data into that file in chunks of 1Kb.
fallocate is returning me 0, therefore it was successful.
However I don't see any performance gains compared to a version of
that same code that doesn't call fallocate.

The test code which does this is:  http://friendpaste.com/2UR0n2U851u4IXmubeLZh0

Am I doing something wrong?

fallocate() gives users the ability to allocate space instantly. One way
to compare would be to time just fallocate() with another program
writing zeros for that length.

But that's not the aim of the syscall. The aim is to allow the fs to allocate
the space in as large chunks as possible to allow for better read
performance.

If you don't do fallocate() and allow writes to allocate in small chunks,
as you are doing, the allocations on disks could be interleaved in face of
multiple processes doing the same. Fragmented allocations can only hurt
read performance.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux