[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yacgtmlni4jlrdybwpzw7nzpvu3sg4n2hzu3fxvxa4gskduvb6@tu5nfo5e4hra>
Date: Wed, 27 Aug 2025 17:28:47 +0200
From: Jan Kara <jack@...e.cz>
To: Julian Sun <sunjunchao@...edance.com>
Cc: linux-ext4@...r.kernel.org, tytso@....edu, jack@...e.cz,
harshadshirwadkar@...il.com, ritesh.list@...il.com
Subject: Re: [PATCH] ext4: Increase IO priority of fastcommit.
On Wed 27-08-25 20:18:12, Julian Sun wrote:
> The following code paths may result in high latency or even task hangs:
> 1. fastcommit io is throttled by wbt.
> 2. jbd2_fc_wait_bufs() might wait for a long time while
> JBD2_FAST_COMMIT_ONGOING is set in journal->flags, and then
> jbd2_journal_commit_transaction() waits for the
> JBD2_FAST_COMMIT_ONGOING bit for a long time while holding the write
> lock of j_state_lock.
> 3. start_this_handle() waits for read lock of j_state_lock which
> results in high latency or task hang.
>
> Given the fact that ext4_fc_commit() already modifies the current
> process' IO priority to match that of the jbd2 thread, it should be
> reasonable to match jbd2's IO submission flags as well.
>
> Suggested-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
> Signed-off-by: Julian Sun <sunjunchao@...edance.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/ext4/fast_commit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> index 42bee1d4f9f9..fa66b08de999 100644
> --- a/fs/ext4/fast_commit.c
> +++ b/fs/ext4/fast_commit.c
> @@ -663,7 +663,7 @@ void ext4_fc_track_range(handle_t *handle, struct inode *inode, ext4_lblk_t star
>
> static void ext4_fc_submit_bh(struct super_block *sb, bool is_tail)
> {
> - blk_opf_t write_flags = REQ_SYNC;
> + blk_opf_t write_flags = JBD2_JOURNAL_REQ_FLAGS;
> struct buffer_head *bh = EXT4_SB(sb)->s_fc_bh;
>
> /* Add REQ_FUA | REQ_PREFLUSH only its tail */
> --
> 2.20.1
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists