All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dave Jones <davej@redhat.com>, Josh Boyer <jboyer@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: hugetlbfs lockdep spew revisited.
Date: Fri, 17 Feb 2012 00:27:26 +0000	[thread overview]
Message-ID: <20120217002726.GL23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20120217000856.GA13112@redhat.com>

On Thu, Feb 16, 2012 at 07:08:57PM -0500, Dave Jones wrote:
> Remember this ? https://lkml.org/lkml/2011/4/15/272
> Josh took a stab at fixing it in e096d0c7e2e4e5893792db865dd065ac73cf1f00,
> but it seems to still be there.

> the existing dependency chain (in reverse order) is:

[snip]

... and as bloody usual, that mentioning of readdir in the output is a
red herring; the real problem (and yes, it *is* deadlock-prone) is not
with getdents(2) that cannot happen on anything that could be mmaped;
it's with hugetlbfs_read() (i.e. read(2)) that very definitely *can*.

This is *not* a misannotation and not a false positive; this is a real,
honest deadlock.
Thread A:
	read() on hugetlbfs
	hugetlbfs_read() called
	i_mutex grabbed
	hugetlbfs_read_actor() called
	__copy_to_user() called
	page fault is triggered
Thread B, sharing address space with A:
	mmap() the same file
	->mmap_sem is grabbed on task_B->mm->mmap_sem
	hugetlbfs_file_mmap() is called
	attempt to grab ->i_mutex and block waiting for A to give it up
Thread A:
	pagefault handled blocked on attempt to grab task_A->mm->mmap_sem,
which happens to be the same thing as task_B->mm->mmap_sem.  Block waiting
for B to give it up.

Deadlock.

  parent reply	other threads:[~2012-02-17  0:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17  0:08 hugetlbfs lockdep spew revisited Dave Jones
2012-02-17  0:16 ` Josh Boyer
2012-02-17  0:34   ` Al Viro
2012-02-17  0:38   ` Tyler Hicks
2012-02-17  0:49     ` Al Viro
2012-02-17  3:42       ` Tyler Hicks
2012-02-21 18:21         ` Mimi Zohar
2012-02-17  6:47       ` J. R. Okajima
2012-02-17 17:48       ` udf deadlock (was Re: hugetlbfs lockdep spew revisited.) Al Viro
2012-02-20 16:01         ` Jan Kara
2012-02-18 10:55       ` hugetlbfs lockdep spew revisited Aneesh Kumar K.V
2012-02-17  0:27 ` Al Viro [this message]
2012-02-23  9:27   ` Aneesh Kumar K.V

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=20120217002726.GL23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=jboyer@redhat.com \
    --cc=linux-kernel@vger.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 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.