Index: linux-2.6.8.1-ck6/fs/jbd/checkpoint.c =================================================================== --- linux-2.6.8.1-ck6.orig/fs/jbd/checkpoint.c 2004-09-04 01:13:33.000000000 +1000 +++ linux-2.6.8.1-ck6/fs/jbd/checkpoint.c 2004-09-08 19:23:14.997061529 +1000 @@ -462,8 +462,9 @@ int cleanup_journal_tail(journal_t *jour * * Find all the written-back checkpoint buffers in the journal and release them. * - * Called with j_list_lock held, drops it. - * Returns number of bufers reaped + * Called with the journal locked. + * Called with j_list_lock held. + * Returns number of bufers reaped (for debug) */ int __journal_clean_checkpoint_list(journal_t *journal) @@ -473,7 +474,7 @@ int __journal_clean_checkpoint_list(jour transaction = journal->j_checkpoint_transactions; if (transaction == 0) - goto out_unlock; + goto out; last_transaction = transaction->t_cpprev; next_transaction = transaction; @@ -490,41 +491,13 @@ int __journal_clean_checkpoint_list(jour do { jh = next_jh; next_jh = jh->b_cpnext; - /* Use trylock because of the ranking */ + /* Use trylock because of the ranknig */ if (jbd_trylock_bh_state(jh2bh(jh))) ret += __try_to_free_cp_buf(jh); } while (jh != last_jh); } -#ifdef CONFIG_PREEMPT - /* - * This is potentially sucky: semi-quadratic performance if - * there are a lot of dirty buffers. So only do it if the user - * has chosen a preemptible kernel. If !CONFIG_PREEMPT we're - * optimimising for straight-line performance, after all. - * We don't test cond_resched() here because another CPU could - * be waiting on j_list_lock() while holding a different lock. - */ - if ((ret & 127) == 127) { - spin_unlock(&journal->j_list_lock); - /* - * We need to schedule away. Rotate both this - * transaction's buffer list and the checkpoint list to - * try to avoid quadratic behaviour. - */ - jh = transaction->t_checkpoint_list; - if (jh) - transaction->t_checkpoint_list = jh->b_cpnext; - - transaction = journal->j_checkpoint_transactions; - if (transaction) - journal->j_checkpoint_transactions = - transaction->t_cpnext; - return ret; - } -#endif } while (transaction != last_transaction); -out_unlock: - spin_unlock(&journal->j_list_lock); +out: return ret; } Index: linux-2.6.8.1-ck6/fs/jbd/commit.c =================================================================== --- linux-2.6.8.1-ck6.orig/fs/jbd/commit.c 2004-09-08 18:20:43.000000000 +1000 +++ linux-2.6.8.1-ck6/fs/jbd/commit.c 2004-09-08 19:23:14.998061373 +1000 @@ -209,16 +209,9 @@ void journal_commit_transaction(journal_ * checkpoint lists. We do this *before* commit because it potentially * frees some memory */ - spin_unlock(&journal->j_state_lock); - { - int nr_cleaned; - - do { - spin_lock(&journal->j_list_lock); - nr_cleaned = __journal_clean_checkpoint_list(journal); - } while (nr_cleaned); - } - spin_lock(&journal->j_state_lock); + spin_lock(&journal->j_list_lock); + __journal_clean_checkpoint_list(journal); + spin_unlock(&journal->j_list_lock); jbd_debug (3, "JBD: commit phase 1\n");