Skip to content

RFC Ext4 fast commit performance patch series

Harshad Shirwadkar linux-ext4 llvm 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 RFC Latest8 patches 0 repliesNew
  2. v36 patches 5 repliesSuperseded
  3. v25 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches6 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8ext4: convert i_fc_lock to spinlockfs/ext4/ext4.h fs/ext4/fast_commit.c fs/ext4/super.c+16 -150 replies
2/8ext4: for committing inode, make ext4_fc_track_inode waitfs/ext4/fast_commit.c fs/ext4/inline.c fs/ext4/inode.c+37 -10 replies
3/8ext4: use extent status tree in fast commit pathfs/ext4/extents_status.c fs/ext4/fast_commit.c+4 -20 replies
4/8ext4: rework fast commit commit pathfs/ext4/fast_commit.c fs/jbd2/journal.c+48 -270 replies
5/8ext4: ext4_fc_track_inode() bug fixfs/ext4/fast_commit.c+1 -20 replies
6/8ext4: drop i_fc_updates from inode fc infofs/ext4/ext4.h fs/ext4/fast_commit.c+0 -750 replies
7/8ext4: add lockdep annotation in fc commit pathfs/ext4/ext4.h fs/ext4/fast_commit.c+19 -20 replies
8/8ext4: update code documentationfs/ext4/fast_commit.c+26 -130 replies

Reviews trailers per patch

4 of 8 patches have a Reviewed-by or Acked-by.

PatchJan Kara
1/8R-b
2/8
3/8
4/8R-b
5/8
6/8R-b
7/8
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [RFC PATCH v4 0/8] Ext4 fast commit performance patch series

This is the V4 of the patch series. This patch series supersedes the patch "ext4: remove journal barrier during fast commit" sent in Feb 2022.

The main difference from V3 is that this patch series makes use extent status tree in the commit path. While this results in no regressions in the "quick" group, there is a failure in "log" group (generic/311) when fast commit is turned on. I am in the middle of getting to the root of it, but my experiments so far suggest that there is an inconsistency in ext4_map_blocks()'s behavior when "EXT4_GET_BLOCKS_CACHED_NOWAIT" flag is passed even if shrinking es tree is disabled. Due to that failure, I have converted this patch series to RFC. I will update the series once I fix the inconsistency issue. But, I wanted to get the current version out any way to get feedback on the direction this patch series going and also to potentially catch issues that I might have missed.

Original Cover Letter
---------------------

This patch series reworks the fast commit's commit path to improve overall performance of the commit path. Following optimizations have been added in this series:

* Avoid having to lock the journal throughout the fast commit.
* Remove tracking of open handles per inode.

With the changes introduced in this patch series, now the commit path for fast commits is as follows:

[1] Lock the journal by calling jbd2_journal_lock_updates. This ensures that all the exsiting handles finish and no new handles can start.
[2] Mark all the fast commit eligible inodes as undergoing fast commit by setting "EXT4_STATE_FC_COMMITTING" state.
[3] Unlock the journal by calling jbd2_journal_unlock_updates. This allows starting of new handles. If new handles try to start an update on any of the inodes that are being committed, ext4_fc_track_inode() will block until those inodes have finished the fast commit.
[4] Submit data buffers of all the committing inodes.
[5] Wait for [4] to complete.
[6] Commit all the directory entry updates in the fast commit space.
[7] Commit all the changed inodes in the fast commit space and clear "EXT4_STATE_FC_COMMITTING" for all the inodes.
[8] Write tail tag to ensure atomicity of commits.

(The above flow has been documented in the code as well)

I verified that the patch series introduces no regressions in "quick" and "log" groups when "fast_commit" feature is enabled.

Harshad Shirwadkar (8):
ext4: convert i_fc_lock to spinlock
ext4: for committing inode, make ext4_fc_track_inode wait
ext4: use extent status tree in fast commit path
ext4: rework fast commit commit path
ext4: ext4_fc_track_inode() bug fix
ext4: drop i_fc_updates from inode fc info
ext4: add lockdep annotation in fc commit path
ext4: update code documentation

 fs/ext4/ext4.h           |  21 ++--
 fs/ext4/extents_status.c |   3 +-
 fs/ext4/fast_commit.c    | 248 ++++++++++++++++++++-------------------
 fs/ext4/inline.c         |   3 +
 fs/ext4/inode.c          |   5 +-
 fs/ext4/super.c          |   2 +-
 fs/jbd2/journal.c        |   2 -
 7 files changed, 149 insertions(+), 135 deletions(-)
Signature · 1 line
2.37.0.170.g444d1eabd0-goog