Skip to content

ext3: Reduce calling ext3_mark_inode_dirty() for speedup

Kazuya Mio linux-ext4 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ext3: Don't call dquot_free_block() if we don't update anythingfs/ext3/balloc.c+5 -21 reply
2/2ext3: Don't update ctime in ext3_splice_branch()fs/ext3/inode.c+0 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] ext3: Reduce calling ext3_mark_inode_dirty() for speedup

ext3 has a performance problem that parallel write is too slow. I looked into this and found out that ext3 calls ext3_mark_inode_dirty() unnecessarily.

The following result is the time of writing 16 files whose size are 3GB by 16 threads. This measurement was performed in linux3.3-rc1 with 4-way server, 512GB memory.

    filesystem        time(sec)  call ext3_mark_inode_dirty(times)
    ---
    ext3              220.5      50,338,104
    ext3 (patched)    196.3      25,169,658
    ext4 (*1)         190.3      28,465,799

    *1 disable ext4-specific option (delalloc, extent, and so on)

ext3 in RHEL5.5 clearly shows the difference in performance. Writing by the same method takes 533 seconds, though writing by one thread takes 191 seconds.

Every time we write one page, ext3 calls ext3_mark_inode_dirty() four times. Two of these are unnecessary in many case, so I add the conditions to call the function only when it is necessary.

sys_write
...
__generic_file_aio_write
file_update_time
mark_inode_dirty_sync
generic_file_buffered_write
...
ext3_get_blocks_handle
ext3_write_begin
...
ext3_new_blocks
vfs_dq_alloc_block
1) mark_inode_dirty
vfs_dq_free_block
2) mark_inode_dirty <-- patch 1/2
ext3_splice_branch
3) ext3_mark_inode_dirty <-- patch 2/2
ext3_ordered_write_end
update_file_sizes
4) mark_inode_dirty

Regards,
Kazuya Mio