All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaying Zhang <jiayingz@google.com>
To: "Ted Ts'o" <tytso@mit.edu>
Cc: Tao Ma <tm@tao.ma>, Dave Chinner <david@fromorbit.com>,
	linux-ext4@vger.kernel.org
Subject: Re: [URGENT PATCH] ext4: fix potential deadlock in ext4_evict_inode()
Date: Tue, 30 Aug 2011 18:15:23 -0700	[thread overview]
Message-ID: <CAFgt=MBOnhCQG+dmHa1crFKU4+XL6RyihnMq=-O8UuK4yEEXnA@mail.gmail.com> (raw)
In-Reply-To: <CAFgt=MA+YokAz4Nzd+OFk7XTDYXMbjXv8G_oXFieDMDr-u4RAg@mail.gmail.com>

FYI, I just sent out a patch to the linux-ext4@ that uses
mutex_trylock() in ext4_end_io_work() and removes the i_mutex
lock and ext4_flush_completed_IO() in ext4_evict_inode():
http://www.spinics.net/lists/linux-ext4/msg27407.html

Jiaying

On Fri, Aug 26, 2011 at 10:17 PM, Jiaying Zhang <jiayingz@google.com> wrote:
> On Fri, Aug 26, 2011 at 1:22 PM, Ted Ts'o <tytso@mit.edu> wrote:
>> On Fri, Aug 26, 2011 at 09:58:45AM -0700, Jiaying Zhang wrote:
>>> Now thinking about an alternative approach to resolve the deadlock
>>> mentioned above, maybe we can use mutex_trylock() in
>>> ext4_end_io_work() and if we can't grab the mutex lock for an inode,
>>> just requeue the work to the end of workqueue?
>>
>> Good idea!  That should speed up work queue processing in general, I
>> think.
>>
>> The downside is that inodes that currently locked might take longer to
>> complete.  In the case of fsync() we'll just force the I/O completion
>> to happen in the context of the fsync'ing process, so I don't think it
>> should be a problem in practice I think.
>>
> Ted,
>
> I am working on a patch to use mutex_trylock() in ext4_end_io_work()
> so that we can fix the described deadlock without needing to call
> mutex_lock() and  ext4_flush_completed_IO() in ext4_evict_inode().
> I run into some problem while testing it. Given that the deadlock my
> original patch intended to fix only exists with dioread_nolock enabled
> but the lockdep issue happens in all of cases, I think we should roll
> that part back as you have planned. I am going to send a separate patch
> later to fix the deadlock issue once I resolved the problem found in
> my test.
>
> Jiaying
>
>>                                        - Ted
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2011-08-31  1:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  3:33 [URGENT PATCH] ext4: fix potential deadlock in ext4_evict_inode() Theodore Ts'o
2011-08-26  3:56 ` Tao Ma
2011-08-26  9:28   ` Tao Ma
2011-08-26  7:35 ` Dave Chinner
2011-08-26  7:42   ` Tao Ma
2011-08-26  8:44   ` Dave Chinner
2011-08-26  8:50     ` Christoph Hellwig
2011-08-26  9:10       ` Tao Ma
2011-08-26  9:17         ` Christoph Hellwig
2011-08-26 11:35           ` Theodore Tso
2011-08-26 14:53             ` Tao Ma
2011-08-26  9:03     ` Tao Ma
2011-08-26  9:24       ` Dave Chinner
2011-08-26  9:27         ` Tao Ma
2011-08-26 15:52           ` Ted Ts'o
2011-08-26 16:58             ` Jiaying Zhang
2011-08-26 20:22               ` Ted Ts'o
2011-08-27  5:17                 ` Jiaying Zhang
2011-08-31  1:15                   ` Jiaying Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFgt=MBOnhCQG+dmHa1crFKU4+XL6RyihnMq=-O8UuK4yEEXnA@mail.gmail.com' \
    --to=jiayingz@google.com \
    --cc=david@fromorbit.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tm@tao.ma \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.