From: Sasha Levin <sasha.levin@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
akpm@linux-foundation.org, linux-mm@kvack.org,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC 1/2] mm: additional page lock debugging
Date: Mon, 10 Feb 2014 18:19:44 -0500 [thread overview]
Message-ID: <52F95E90.3030402@oracle.com> (raw)
In-Reply-To: <20140106100408.GC31570@twins.programming.kicks-ass.net>
>> This triggers two problems:
>>
>> - lockdep complains about deadlock since we try to lock another page while one is already
>> locked. I can clear that by allowing page locks to nest within each other, but that seems
>> wrong and we'll miss actual deadlock cases.
>
> Right,.. I think we can cobble something together like requiring we
> always lock pages in pfn order or somesuch.
>
Sorry, I went ahead to dig into mm/lockdep based on your comments and noticed I forgot to reply
to this mail.
Getting them to lock in pfn order seems to be a bit of a mess since we need to keep the free
lists sorted. I didn't find a nice way of doing it without having to do insertion sort which slows
everything down.
>> - We may leave back to userspace with pages still locked. This is valid behaviour but lockdep
>> doesn't like that.
>
> Where do we actually do this? BTW its not only lockdep not liking that,
> Linus was actually a big fan of that check.
>
> ISTR there being some filesystem freezer issues with that too, where the
> freeze ioctl would return to userspace with 'locks' held and that's
> cobbled around (or maybe gone by now -- who knows).
>
> My initial guess would be that this is AIO/DIO again, those two seem to
> be responsible for the majority of ugly around there.
Indeed, the block layer has multiple "violations". In the AIO case, we lock pages in one task
and leave back to userspace, and those pages get unlocked by a completion thread which runs at
some point later.
Right now I gave up on getting lockdep fully integrated in, and am trying to fix as many of these
issues as possible by detecting trivial cases and fixing those. I feel that adding lockdep in at
this point is way more complex than what we need done. We don't really need lockdep to detect pretty
trivial cases of double locking on the very same lock...
When we got rid of everything we can easily spot, lockdep should move in to detect anything more
complex.
Thanks,
Sasha
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2014-02-10 23:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-29 1:45 [RFC 1/2] mm: additional page lock debugging Sasha Levin
2013-12-29 1:45 ` [RFC 2/2] mm: additional checks to page flag set/clear Sasha Levin
2013-12-30 12:12 ` Kirill A. Shutemov
2013-12-30 11:43 ` [RFC 1/2] mm: additional page lock debugging Kirill A. Shutemov
2013-12-30 16:33 ` Sasha Levin
2013-12-30 22:48 ` Kirill A. Shutemov
2013-12-31 3:22 ` Sasha Levin
2013-12-31 16:26 ` Peter Zijlstra
2013-12-31 16:42 ` Sasha Levin
2014-01-06 10:04 ` Peter Zijlstra
2014-02-10 23:19 ` Sasha Levin [this message]
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=52F95E90.3030402@oracle.com \
--to=sasha.levin@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).