mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Mandeep Singh Baines <msb@chromium.org>,
	Ming Lei <ming.lei@canonical.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Ingo Molnar <mingo@redhat.com>
Subject: Re: LOCKDEP: 3.9-rc1: mount.nfs/4272 still has locks held!
Date: Tue, 5 Mar 2013 08:23:08 -0500	[thread overview]
Message-ID: <20130305082308.6607d4db@tlielax.poochiereds.net> (raw)
In-Reply-To: <4FA345DA4F4AE44899BD2B03EEEC2FA9286AEEB0@sacexcmbx05-prd.hq.netapp.com>

On Mon, 4 Mar 2013 22:08:34 +0000
"Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:

> On Mon, 2013-03-04 at 21:53 +0100, Oleg Nesterov wrote:
> > On 03/04, Mandeep Singh Baines wrote:
> > >
> > > The problem is that freezer_count() calls try_to_freeze(). In this
> > > case, try_to_freeze() is not really adding any value.
> > 
> > Well, I tend to agree.
> > 
> > If a task calls __refrigerator() holding a lock which another freezable
> > task can wait for, this is not freezer-friendly.
> > 
> > freezable_schedule/freezer_do_not_count/etc not only means "I won't be
> > active if freezing()", it should also mean "I won't block suspend/etc".
> 
> If suspend for some reason requires a re-entrant mount, then yes, I can
> see how it might be a problem that we're holding a mount-related lock.
> The question is why is that necessary?
> 
> > OTOH, I understand that probably it is not trivial to change this code
> > to make it freezer-friendly. But at least  I disagree with "push your
> > problems onto others".
> 
> That code can't be made freezer-friendly if it isn't allowed to hold
> basic filesystem-related locks across RPC calls. A number of those RPC
> calls do things that need to be protected by VFS or MM-level locks.
> i.e.: lookups, file creation/deletion, page fault in/out, ...
>  
> IOW: the problem would need to be solved differently, possibly by adding
> a new FIFREEZE-like call to allow the filesystem to quiesce itself
> _before_ NetworkManager pulls the rug out from underneath it. There
> would still be plenty of corner cases to keep people entertained (e.g.
> the server goes down before the quiesce call is invoked) but at least
> the top 90% of cases would be solved.
> 

Ok, I think I'm starting to get it. It doesn't necessarily need a
reentrant mount or anything like that. Consider this case (which is not
even that unlikely):

Suppose there are two tasks calling unlink() on files in the same NFS
directory.

First task takes the i_mutex on the parent directory and goes to ask
the server to remove the file. Second task calls unlink just
afterward and blocks on the parent's i_mutex.

Now, a suspend event comes in and freezes the first task while it's
waiting on the response. It still holds the parent's i_mutex. Freezer
now gets to the second task and can't freeze it because the sleep on
that mutex isn't freezable.

So, not a deadlock per-se in this case but it does prevent the freezer
from running to completion. I don't see any way to solve it though w/o
making all mutexes freezable. Note that I don't think this is really
limited to NFS either -- a lot of other filesystems will have similar
problems: CIFS, some FUSE variants, etc...

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2013-03-05 13:23 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 13:57 Ming Lei
2013-03-04 14:14 ` Myklebust, Trond
2013-03-04 14:23   ` Jeff Layton
2013-03-04 19:55     ` Mandeep Singh Baines
2013-03-04 20:53       ` Oleg Nesterov
2013-03-04 22:08         ` Myklebust, Trond
2013-03-05 13:23           ` Jeff Layton [this message]
2013-03-05 17:46             ` Tejun Heo
2013-03-05 17:49               ` Tejun Heo
2013-03-05 19:03                 ` Jeff Layton
2013-03-05 19:09                   ` Tejun Heo
2013-03-05 23:39                     ` Jeff Layton
2013-03-05 23:47                       ` Tejun Heo
2013-03-06 18:16                         ` Oleg Nesterov
2013-03-06 18:53                           ` Tejun Heo
2013-03-06 21:00                             ` Linus Torvalds
2013-03-06 21:24                               ` Tejun Heo
2013-03-06 21:31                                 ` Linus Torvalds
2013-03-06 21:36                                   ` Tejun Heo
2013-03-06 21:40                                     ` Tejun Heo
2013-03-13 15:17                                       ` Jeff Layton
2013-03-31  0:07                                         ` Paul Walmsley
2013-03-07 11:41                                     ` Jeff Layton
2013-03-07 15:25                                       ` Tejun Heo
2013-03-07 15:55                                       ` Linus Torvalds
2013-03-07 15:59                                         ` Myklebust, Trond
2013-03-07 16:25                                           ` Linus Torvalds
2013-03-07 16:45                                             ` Myklebust, Trond
2013-03-07 17:03                                               ` Linus Torvalds
2013-03-07 17:16                                                 ` Myklebust, Trond
2013-03-07 21:43                                                   ` Jeff Layton
2013-03-08 14:01                                                 ` Ingo Molnar
2013-03-07 20:55                                             ` Rafael J. Wysocki
2013-03-07 16:00                                         ` Tejun Heo
2013-03-06 18:17                       ` Oleg Nesterov
2013-03-06 18:40                         ` Jeff Layton
2013-03-06 18:45                           ` Tejun Heo
2013-03-06  1:10                   ` Myklebust, Trond
2013-03-06  1:14                     ` Tejun Heo
2013-03-06  1:28                       ` Tejun Heo
2013-03-06 12:00                     ` Jeff Layton
2013-03-05 23:11                 ` J. Bruce Fields
2013-03-06  0:02                   ` Rafael J. Wysocki
2013-03-06  0:30                   ` [PATCH] lockdep: make lock held while freezing check optional Mandeep Singh Baines
2013-03-07 12:03                     ` Maarten Lankhorst
2013-03-06  0:59                   ` LOCKDEP: 3.9-rc1: mount.nfs/4272 still has locks held! Mandeep Singh Baines
2013-03-06  1:05                     ` J. Bruce Fields
2013-03-06  1:16                       ` Tejun Heo
2013-03-06  3:11                         ` Mandeep Singh Baines
2013-03-06  9:09                           ` Ingo Molnar
2013-03-06 12:06                             ` Jeff Layton
2013-03-06 15:59                               ` Mandeep Singh Baines
2013-03-06 18:23                                 ` Jeff Layton
2013-03-06 18:37                                   ` Myklebust, Trond
2013-03-06 20:15                                     ` Mandeep Singh Baines
2013-03-04 14:40   ` Ming Lei
2013-03-04 15:04     ` Jeff Layton
2013-03-04 15:33       ` Ming Lei
2013-03-04 15:53         ` Myklebust, Trond
2013-03-04 20:09           ` Mandeep Singh Baines
2013-03-04 20:10             ` Mandeep Singh Baines

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=20130305082308.6607d4db@tlielax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=mingo@redhat.com \
    --cc=msb@chromium.org \
    --cc=oleg@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®