From: Andrew Morton <akpm@osdl.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: aia21@cam.ac.uk, nickpiggin@yahoo.com.au, eike-kernel@sf-tec.de,
linux-kernel@vger.kernel.org, aia21@cantab.net,
arjan@infradead.org
Subject: Re: [BUG?] possible recursive locking detected
Date: Thu, 27 Jul 2006 11:04:25 -0700 [thread overview]
Message-ID: <20060727110425.5cd40bd9.akpm@osdl.org> (raw)
In-Reply-To: <20060727144542.GA27451@elte.hu>
On Thu, 27 Jul 2006 16:45:43 +0200
Ingo Molnar <mingo@elte.hu> wrote:
>
> * Anton Altaparmakov <aia21@cam.ac.uk> wrote:
>
> > Note that even the above patch is not a 100% solution. What
> > guarantees are there that the page faulted in will still be around
> > when it is read a few lines down the line in the code? Given
> > sufficient parallel memory pressure/io pressure it can still cause the
> > page to be evicted again immediately after it is faulted in...
> >
> > All the above patch does is to _dramatically_ reduce the race window
> > for this happening but it does not eliminate it in theory (AFAICS).
> >
> > So if your stance is that deadlocks are completely unacceptable it
> > still is not fixed. If your stance is that _really_ unlikely
> > deadlocks are acceptable then it is fixed.
>
> my 'stance' is pretty common-sense: exploitable deadlocks (it's possible
> to force eviction of a page), or even hard-to-trigger but possible
> deadlocks (which are not associated with hopeless resource exhaustation)
> must be fixed.
Yeah. It's super-hard to hit though - I spent some time trying to do so
back in 2.5.<late> and was unable to do so.
And nobody is likely to hit it in production because nobody will go and
write() into a pagecache page from a mmapped copy of the same page
(surely?). So it's the deliberately-triggered deadlocks we need to be
concerned of here.
That's for ext2/3. I didn't know about the reiserfs problem.
> couldnt we exclude the case of 'write writing to the same page it is
> reading from' abuse, to avoid the deadlock problem?
That would involve doing a follow_page() to get at the other pageframe. If
we were to do that, we could just pin the page. But we've always been
reluctant to add the cost of that.
I guess we could fix it by making the copy_to/from_user be atomic and if it
faults, drop the page lock, loop around and try again.
There's a more serious deadlock in there: an ab/ba deadlock between
journal_start() and lock_page(). It's hard to fix.
next prev parent reply other threads:[~2006-07-27 18:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-26 16:05 [BUG?] possible recursive locking detected Rolf Eike Beer
2006-07-27 5:53 ` Andrew Morton
2006-07-27 6:51 ` Nick Piggin
2006-07-27 7:15 ` Anton Altaparmakov
2006-07-27 7:38 ` Andrew Morton
2006-07-27 8:19 ` Anton Altaparmakov
2006-07-27 8:53 ` Andrew Morton
2006-07-27 9:28 ` Anton Altaparmakov
2006-07-27 9:46 ` Ingo Molnar
2006-07-27 14:31 ` Anton Altaparmakov
2006-07-27 14:45 ` Ingo Molnar
2006-07-27 18:04 ` Andrew Morton [this message]
2006-07-27 9:18 ` Nick Piggin
2006-07-27 9:35 ` Anton Altaparmakov
2006-07-27 10:02 ` Nick Piggin
2006-07-27 12:30 ` Anton Altaparmakov
2006-07-27 7:24 ` Andrew Morton
2006-07-27 7:29 ` Arjan van de Ven
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=20060727110425.5cd40bd9.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=aia21@cam.ac.uk \
--cc=aia21@cantab.net \
--cc=arjan@infradead.org \
--cc=eike-kernel@sf-tec.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
/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