[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP=VYLofXDGQ5Vjc9S-p1VyVmzYU1ZxcZn5=mDtLZZbtdv9Lig@mail.gmail.com>
Date: Mon, 10 Jun 2013 23:20:50 -0400
From: Paul Gortmaker <paul.gortmaker@...driver.com>
To: "Theodore Ts'o" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org, linux-rt-users@...r.kernel.org
Subject: Re: [PATCH 2/4] jbd2/log_wait_for_space: drop checkpoint mutex when waiting
On Mon, Jun 10, 2013 at 10:33 PM, Theodore Ts'o <tytso@....edu> wrote:
> On Mon, Jun 10, 2013 at 03:32:01PM -0400, Paul Gortmaker wrote:
>>
>> What is interesting here, is that we call log_wait_commit, from
>> within wait_for_space, but we are still holding the checkpoint_mutex
>> as it surrounds mostly the whole of wait_for_space. And then, as we
>> are waiting, journal_commit_transaction can run, and if the JBD2_FLUSHED
>> bit is set, then we will also try to take the same checkpoint_mutex.
>
>> } else if (tid) {
>> + /*
>> + * jbd2_journal_commit_transaction() may want
>> + * to take the checkpoint_mutex if JBD2_FLUSHED
>> + * is set. So we need to temporarily drop it.
>> + */
>> + mutex_unlock(&journal->j_checkpoint_mutex);
>> jbd2_log_wait_commit(journal, tid);
>> + mutex_lock(&journal->j_checkpoint_mutex);
>> } else {
>> printk(KERN_ERR "%s: needed %d blocks and "
>> "only had %d space available\n",
>
> After we execute the code in the else cause, we drop through to just
> before the bottom of the while loop, where we see:
>
> mutex_unlock(&journal->j_checkpoint_mutex);
> }
>
> So it would be better to change things like this instead, so we don't
> end up grabbing and releasing the j_checkpoint_mutex unnecessarily:
>
> } else if (tid) {
> + /*
> + * jbd2_journal_commit_transaction() may want
> + * to take the checkpoint_mutex if JBD2_FLUSHED
> + * is set. So we need to temporarily drop it.
> + */
> + mutex_unlock(&journal->j_checkpoint_mutex);
> jbd2_log_wait_commit(journal, tid);
> + write_lock(&journal->j_state_lock);
> + continue;
> } else {
> printk(KERN_ERR "%s: needed %d blocks and "
> "only had %d space available\n",
>
> Could you try respinning the patch like this and testing the result?
Absolutely; will do that tomorrow and re-test on 3.10-rc5.
And I'll keep it in my preempt-rt testing queue too, as I keep
looking into that RT problem.
Thanks for reviewing and confirming it could be a real problem.
Paul.
--
>
> Thanks,
>
> - Ted
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists