From: Michel Lespinasse <walken@google.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Sean Noonan <Sean.Noonan@twosigma.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Martin Bligh <Martin.Bligh@twosigma.com>,
Trammell Hudson <Trammell.Hudson@twosigma.com>,
Christos Zoulas <Christos.Zoulas@twosigma.com>,
"linux-xfs@oss.sgi.com" <linux-xfs@oss.sgi.com>,
Stephen Degler <Stephen.Degler@twosigma.com>,
linux-mm@kvack.org
Subject: Re: XFS memory allocation deadlock in 2.6.38
Date: Thu, 24 Mar 2011 16:45:40 -0700 [thread overview]
Message-ID: <AANLkTikwwRm6FHFtEdUg54NvmKdswQw-NPH5dtq1mXBK@mail.gmail.com> (raw)
In-Reply-To: <20110324174311.GA31576@infradead.org>
On Thu, Mar 24, 2011 at 10:43 AM, Christoph Hellwig <hch@infradead.org> wrote:
> Michel,
>
> can you take a look at this bug report? It looks like a regression
> in your mlock handling changes.
I had a quick look and at this point I can describe how the patch will
affect behavior of this test, but not why this causes a deadlock with
xfs.
The test creates a writable, shared mapping of a file that does not
have data blocks allocated on disk, and also uses the MAP_POPULATE
flag.
Before 5ecfda041e4b4bd858d25bbf5a16c2a6c06d7272, make_pages_present
during the mmap would cause data blocks to get allocated on disk with
an xfs_vm_page_mkwrite call, and then the file pages would get mapped
as writable ptes.
After 5ecfda041e4b4bd858d25bbf5a16c2a6c06d7272, make_pages_present
does NOT cause data blocks to get allocated on disk. Instead,
xfs_vm_readpages is called, which (I suppose) does not allocate the
data blocks and returns zero filled pages instead, which get mapped as
readonly ptes. Later, the test tries writing into the mmap'ed block,
causing minor page faults, xfs_vm_page_mkwrite calls and data block
allocations to occur.
Regarding the deadlock: I am curious to see if it could be made to
happen before 5ecfda041e4b4bd858d25bbf5a16c2a6c06d7272. Could you test
what happens if you remove the MAP_POPULATE flag from your mmap call,
and instead read all pages from userspace right after the mmap ? I
expect you would then be able to trigger the deadlock before
5ecfda041e4b4bd858d25bbf5a16c2a6c06d7272.
This leaves the issue of the change of behavior for MAP_POPULATE on
ftruncated file holes. I'm not sure what to say there though, because
MAP_POPULATE is documented to cause file read-ahead (and it still does
after 5ecfda041e4b4bd858d25bbf5a16c2a6c06d7272), but that doesn't say
anything about block allocation.
Hope this helps,
--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-03-24 23:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <081DDE43F61F3D43929A181B477DCA95639B52FD@MSXAOA6.twosigma.com>
[not found] ` <081DDE43F61F3D43929A181B477DCA95639B5327@MSXAOA6.twosigma.com>
2011-03-24 17:43 ` XFS memory allocation deadlock in 2.6.38 Christoph Hellwig
2011-03-24 23:45 ` Michel Lespinasse [this message]
2011-03-28 14:58 ` Sean Noonan
2011-03-28 21:06 ` Michel Lespinasse
2011-03-28 21:34 ` Sean Noonan
2011-03-29 0:25 ` Michel Lespinasse
2011-03-29 1:51 ` Dave Chinner
2011-03-29 2:49 ` Sean Noonan
2011-03-29 19:05 ` Sean Noonan
2011-03-29 19:24 ` 'Christoph Hellwig'
2011-03-29 19:39 ` Johannes Weiner
2011-03-29 19:43 ` 'Christoph Hellwig'
2011-03-29 19:46 ` Sean Noonan
2011-03-29 20:02 ` 'Christoph Hellwig'
2011-03-29 20:23 ` Sean Noonan
2011-03-29 22:42 ` Dave Chinner
2011-03-29 22:45 ` Sean Noonan
2011-03-30 9:23 ` 'Christoph Hellwig'
2011-03-29 19:54 ` Sean Noonan
2011-03-30 0:09 ` Dave Chinner
2011-03-30 1:32 ` Sean Noonan
2011-03-30 1:44 ` Dave Chinner
2011-03-30 1:52 ` Sean Noonan
2011-03-30 9:30 ` 'Christoph Hellwig'
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=AANLkTikwwRm6FHFtEdUg54NvmKdswQw-NPH5dtq1mXBK@mail.gmail.com \
--to=walken@google.com \
--cc=Christos.Zoulas@twosigma.com \
--cc=Martin.Bligh@twosigma.com \
--cc=Sean.Noonan@twosigma.com \
--cc=Stephen.Degler@twosigma.com \
--cc=Trammell.Hudson@twosigma.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@oss.sgi.com \
/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).