From 9e77aa68d4fa3034805dcc61e887d52a93b5395c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Dec 2003 05:43:22 -0800 Subject: [PATCH] [PATCH] ext3 scheduling latency fix Sometimes kjournald has to refile a huge number of buffers, because someone else wrote them out beforehand - they are all clean. This happens under a lock and scheduling latencies of 88 milliseconds on a 2.7GHx CPU were observed. The patch forward-ports a little bit of the 2.4 low-latency patch to fix this problem. Worst-case on ext3 is now sub-half-millisecond, except for when the RCU dentry reaping softirq cuts in :( --- fs/jbd/commit.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index 4ee3c3e18f436..78aaded6d2d9e 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c @@ -264,6 +264,16 @@ write_out_data_locked: jbd_unlock_bh_state(bh); journal_remove_journal_head(bh); __brelse(bh); + if (need_resched() && commit_transaction-> + t_sync_datalist) { + commit_transaction->t_sync_datalist = + next_jh; + if (bufs) + break; + spin_unlock(&journal->j_list_lock); + cond_resched(); + goto write_out_data; + } } } if (bufs == ARRAY_SIZE(wbuf)) { @@ -284,8 +294,7 @@ write_out_data_locked: cond_resched(); journal_brelse_array(wbuf, bufs); spin_lock(&journal->j_list_lock); - if (bufs) - goto write_out_data_locked; + goto write_out_data_locked; } /* -- 2.53.0