linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Miklos Szeredi <miklos@szeredi.hu>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	mgorman@suse.de, gregkh@suse.de, akpm@linux-foundation.org,
	david@fromorbit.com
Subject: Re: [RFC PATCH] shrink_dcache_parent() deadlock
Date: Mon, 9 Jan 2012 11:18:13 -0800	[thread overview]
Message-ID: <CA+55aFweg+A0GmEZM=tTHfMPqT_=7ioq3FBFMefsTgcxEgaXYA@mail.gmail.com> (raw)
In-Reply-To: <20120109190450.GA26390@infradead.org>

On Mon, Jan 9, 2012 at 11:04 AM, Christoph Hellwig <hch@infradead.org> wrote:
>
> After Dave's patch select_parent isolates dentries that are going to
> be dropped directly to an on-stack list instead of abusing the LRU.
>
> With that scheme the trylock and retry loop in __shrink_dcache_sb
> goes away completely for this caller.

Yes, but it still exists for the prune_dcache_sb() case.

So prune_dcache_sb() puts random dentries on its own private lists,
and drops the lru_lock (and the dentry lock).

In the meantime, what protects us from select_parent() finding those
*same* dentries, and doing

    dentry_lru_move_list(dentry, dispose);

which - despite the name - moves the dentry not from the lru list, but
from the prune_dcache_sb local list to the select_parent() local
list..

Hmm. I guess the endless "move back-and-forth" thing is gone, but the
random "move from one private list to another" makes me worry about
the confusion.

But I guess we don't care - the same thing is going to happen to the
dentry regardless of which of the local lists it is on.

And in any case, I think Dave's patch looks like a nice cleanup. Does
it work for people in that forward-ported-alone version I sent out?

And Miklos, does it fix your test-case? Because if so, I think Dave's
patch is nicer, and avoids adding a new state bit by just cleaning
things up in general.

                        Linus

  reply	other threads:[~2012-01-09 19:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 10:58 [RFC PATCH] shrink_dcache_parent() deadlock Miklos Szeredi
2012-01-09 16:43 ` Linus Torvalds
2012-01-09 17:05   ` Miklos Szeredi
2012-01-09 17:16     ` Greg KH
2012-01-09 17:16 ` Christoph Hellwig
2012-01-09 17:30   ` Al Viro
2012-01-09 18:30     ` Linus Torvalds
2012-01-09 18:46       ` Linus Torvalds
2012-01-09 19:04         ` Christoph Hellwig
2012-01-09 19:18           ` Linus Torvalds [this message]
2012-01-09 20:59       ` Dave Chinner
2012-01-09 21:21         ` Linus Torvalds
2012-01-10  1:34           ` Al Viro
2012-01-10  2:02             ` Linus Torvalds
2012-01-10 10:05               ` Miklos Szeredi
2012-01-10 16:00                 ` Linus Torvalds
2012-01-10 16:15                   ` Al Viro
2012-01-10 16:22                   ` Miklos Szeredi
2012-01-10 16:33                     ` Linus Torvalds
2012-01-10 16:50                       ` Miklos Szeredi
2012-01-10 18:04                     ` Al Viro
2012-01-10 21:52                     ` Dave Chinner
2012-01-09 21:26         ` Al Viro
2012-01-09 17:27 ` Al Viro

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='CA+55aFweg+A0GmEZM=tTHfMPqT_=7ioq3FBFMefsTgcxEgaXYA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=gregkh@suse.de \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).