[linux-audio-dev] Re: [announce] [patch] Voluntary Kernel Preemption Patch

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Re: [announce] [patch] Voluntary Kernel Preemption Patch
From: Ingo Molnar (mingo_AT_elte.hu)
Date: Mon Jul 19 2004 - 13:20:30 EEST


* Zwane Mwaikambo <zwane_AT_linuxpower.ca> wrote:

> Looks like some of the voluntary preemption changes might need some
> eyeballing too. This appears to be a use after free, probably since we
> unlocked j_{list,state}_lock.

thx - this is the new __journal_clean_checkpoint_list() chunk:

--- linux/fs/jbd/checkpoint.c.orig
+++ linux/fs/jbd/checkpoint.c
@@ -465,6 +470,7 @@ int __journal_clean_checkpoint_list(jour
         transaction_t *transaction, *last_transaction, *next_transaction;
         int ret = 0;
 
+retry:
         transaction = journal->j_checkpoint_transactions;
         if (transaction == 0)
                 goto out;
@@ -487,6 +493,14 @@ int __journal_clean_checkpoint_list(jour
                                 /* Use trylock because of the ranknig */
                                 if (jbd_trylock_bh_state(jh2bh(jh)))
                                         ret += __try_to_free_cp_buf(jh);
+ if (voluntary_need_resched()) {
+ spin_unlock(&journal->j_list_lock);
+ spin_unlock(&journal->j_state_lock);
+ voluntary_resched();
+ spin_lock(&journal->j_state_lock);
+ spin_lock(&journal->j_list_lock);
+ goto retry;
+ }
                         } while (jh != last_jh);
                 }
         } while (transaction != last_transaction);


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Jul 19 2004 - 13:37:55 EEST