linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] fadvise: add more flags to provide a hint for block allocation
@ 2012-03-05 12:50 Zheng Liu
  2012-03-05 19:48 ` Sunil Mushran
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Zheng Liu @ 2012-03-05 12:50 UTC (permalink / raw)
  To: linux-fsdevel, linux-ext4

Hi list,

Block allocation is a key component of file system.  Every file systems try to
improve the performance with optimizing the block allocation of a file.  But no
matter what file system does, it just guesses what the user expects.  Thus, it
is not very accurate.  fadvise(2) provides a method to let the user to give a
hint to file system.  However, until now, only few flags are provided.  So we
can provide more flags to tell file system how to allocate the blocks for a
file.

For example:
we can add these flags into fadvise(2):
FADV_ALLOC_READ_SEQ
FADV_ALLOC_READ_RANDOM
FADV_ALLOC_WRITE_ONCE
FADV_ALLOC_WRITE_APPEND

FADV_ALLOC_READ_* are not similar with FADV_SEQUENTIAL and FADV_RANDOM.
FADV_ALLOC_READ_SEQ tells file system that this file need to allocate some
sequential blocks, and FADV_ALLOC_READ_RADOM tells file system that this file
can endure the fragmentation.

FADV_ALLOC_WRITE_ONCE indicates that this file just is written once.  So file
system can allocate some sequential blocks for it to improve the read
performance.  FADV_ALLOC_WRITE_APPEND flag is set to point out that data will be
appended to the end of this file, and file system can reserve some blocks for it
to guarantee the sequence as much as possible.

File systems can support a subset of these flags according to its design.  These
flags provide a rich interface that lets the user to control block allocation of
files.  The user could precisely control the allocation of their files to
improve the performance of appliatons.

Any comments or suggestions are appreciated.  Thank you.

Regards,
Zheng

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-03-08 17:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 12:50 [RFC] fadvise: add more flags to provide a hint for block allocation Zheng Liu
2012-03-05 19:48 ` Sunil Mushran
2012-03-06  2:35   ` Zheng Liu
2012-03-06  4:26     ` Sunil Mushran
2012-03-06 13:30       ` Zheng Liu
2012-03-06  8:27 ` Lukas Czerner
2012-03-06 13:56   ` Zheng Liu
2012-03-06 14:29     ` Lukas Czerner
2012-03-06 17:53       ` Sunil Mushran
2012-03-07  8:51         ` Lukas Czerner
2012-03-07 17:11           ` Ted Ts'o
2012-03-07  0:51 ` Dave Chinner
2012-03-07  4:14   ` Andreas Dilger
2012-03-07  5:02     ` Martin K. Petersen
2012-03-07 12:11       ` Dave Chinner
2012-03-08  4:23         ` Martin K. Petersen
2012-03-08  7:07           ` Dave Chinner
2012-03-08 17:01             ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).