[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240818040356.241684-2-harshadshirwadkar@gmail.com>
Date: Sun, 18 Aug 2024 04:03:47 +0000
From: Harshad Shirwadkar <harshadshirwadkar@...il.com>
To: linux-ext4@...r.kernel.org
Cc: tytso@....edu,
jack@...e.cz,
harshads@...gle.com,
Harshad Shirwadkar <harshadshirwadkar@...il.com>
Subject: [PATCH v7 0/9] Ext4 Fast Commit Performance Patchset
V7 Cover Letter
---------------
This is the V7 of the patch series. This patch series contains fixes to
review comments by Jan Kara (<jack@...e.cz>). The main changes are as
follows:
- As discussed in V6 review, I have dropped "ext4: add nolock mode to
ext4_map_blocks()" patch given that we now ensure that i_data_sem is
always grabbed before ext4_mark_inode_dirty() is called.
- I have also dropped "ext4: introduce selective flushing in fast commit"
given that correctly implementing that would require more changes, and I
think they would be best done outside of this series.
- I added "ext4: introduce selective flushing in fast commit" as the last
patch in the series. While testing log group tests I found a few failures
which get fixed due to this patch.
V6 Cover Letter
---------------
This is the V6 of the patch series. This patch series contains fixes to a
bunch of kernel build warnings reported by Kernel Test Robot
(lkp@...el.com) and Dan Carpenter (dan.carpenter@...aro.org). Thank you!
V5 Cover Letter
---------------
This patch series supersedes the patch series "ext4: remove journal barrier
during fast commit" sent in July 2022[1]. Except following three patches
all the other patches are newly introduced in this series.
* ext4: convert i_fc_lock to spinlock
* ext4: for committing inode, make ext4_fc_track_inode wait
* ext4: drop i_fc_updates from inode fc info
This patchset does not introduce any on-disk format and / or user visible
API change. This patchset reworks fast-commit's commit path 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.
* Avoid issuing cache flushes when fast commits are contained within a
single FUA writes and there is no data that needs flushing.
* Temporarily lift committing thread's priority to match that of the
journal thread to reduce scheduling delays.
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_no_rsv(). 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 "log" groups
when "fast_commit" feature is enabled.
Also, we have a paper on fast commits in USENIX ATC 2024 this year which
should become available on the website[2] in a few months.
[1] https://lwn.net/Articles/902022/
[2] https://www.usenix.org/conference/atc24
Harshad Shirwadkar (9):
ext4: convert i_fc_lock to spinlock
ext4: for committing inode, make ext4_fc_track_inode wait
ext4: mark inode dirty before grabbing i_data_sem in ext4_setattr
ext4: rework fast commit commit path
ext4: drop i_fc_updates from inode fc info
ext4: update code documentation
ext4: temporarily elevate commit thread priority
ext4: make fast commit ineligible on ext4_reserve_inode_write failure
ext4: hold s_fc_lock while during fast commit
fs/ext4/ext4.h | 18 +-
fs/ext4/fast_commit.c | 339 ++++++++++++++++++------------------
fs/ext4/fast_commit.h | 1 +
fs/ext4/inline.c | 3 +
fs/ext4/inode.c | 38 ++--
fs/ext4/super.c | 9 +-
fs/jbd2/journal.c | 2 -
include/trace/events/ext4.h | 7 +-
8 files changed, 214 insertions(+), 203 deletions(-)
--
2.46.0.184.g6999bdac58-goog
Powered by blists - more mailing lists