]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: improve write performance with disabled delalloc
authorJan Kara <jack@suse.cz>
Fri, 20 May 2022 11:14:02 +0000 (13:14 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 16 Jun 2022 16:17:56 +0000 (12:17 -0400)
commit5d0eecb4f899e7b024e71169b053fd64fbd9287e
tree2f05d59d2c4233c8aa5a4380ab562a64ee5b57cd
parent7ce05bb5abc347dfb0204058651146a776f0d309
ext4: improve write performance with disabled delalloc

When delayed allocation is disabled (either through mount option or
because we are running low on free space), ext4_write_begin() allocates
blocks with EXT4_GET_BLOCKS_IO_CREATE_EXT flag. With this flag extent
merging is disabled and since ext4_write_begin() is called for each page
separately, we end up with a *lot* of 1 block extents in the extent tree
and following writeback is writing 1 block at a time which results in
very poor write throughput (4 MB/s instead of 200 MB/s). These days when
ext4_get_block_unwritten() is used only by ext4_write_begin(),
ext4_page_mkwrite() and inline data conversion, we can safely allow
extent merging to happen from these paths since following writeback will
happen on different boundaries anyway. So use
EXT4_GET_BLOCKS_CREATE_UNRIT_EXT instead which restores the performance.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220520111402.4252-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c