Commit 9e77aa68 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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 :(
parent c5427c68
...@@ -264,6 +264,16 @@ void journal_commit_transaction(journal_t *journal) ...@@ -264,6 +264,16 @@ void journal_commit_transaction(journal_t *journal)
jbd_unlock_bh_state(bh); jbd_unlock_bh_state(bh);
journal_remove_journal_head(bh); journal_remove_journal_head(bh);
__brelse(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)) { if (bufs == ARRAY_SIZE(wbuf)) {
...@@ -284,7 +294,6 @@ void journal_commit_transaction(journal_t *journal) ...@@ -284,7 +294,6 @@ void journal_commit_transaction(journal_t *journal)
cond_resched(); cond_resched();
journal_brelse_array(wbuf, bufs); journal_brelse_array(wbuf, bufs);
spin_lock(&journal->j_list_lock); spin_lock(&journal->j_list_lock);
if (bufs)
goto write_out_data_locked; goto write_out_data_locked;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment