From: Ingo Molnar <mingo@elte.hu>
To: Nick Piggin <npiggin@suse.de>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [rfc] lockdep: check fs reclaim recursion
Date: Fri, 28 Nov 2008 13:27:15 +0100 [thread overview]
Message-ID: <20081128122715.GH18333@elte.hu> (raw)
In-Reply-To: <20081128122158.GD13786@wotan.suse.de>
* Nick Piggin <npiggin@suse.de> wrote:
> On Fri, Nov 28, 2008 at 01:11:27PM +0100, Ingo Molnar wrote:
> >
> > * Nick Piggin <npiggin@suse.de> wrote:
> >
> > > Hi,
> > >
> > > After yesterday noticing some code in mm/filemap.c accidentally perform
> > > a __GFP_FS allocation when it should not have been, I thought it might
> > > be a good idea to try to catch this kind of thing with lockdep.
> > >
> > > I coded up a little idea that seems to work. Unfortunately the system
> > > has to actually be in __GFP_FS page reclaim, then take the lock, before
> > > it will mark it. But at least that might still be some orders of
> > > magnitude more common (and more debuggable) than an actual deadlock
> > > condition, so we have some improvement I hope.
> > >
> > > I guess we could do the same thing with __GFP_IO and even GFP_NOIO
> > > locks too, but I don't know how expensive it is to add these
> > > annotations to lockdep. [...]
> >
> > Same cost as normal locking, i.e. as cheap and local as it gets. Lockdep
> > is only expensive computationally when new rules are discovered and have
> > to be validated - but that is rare.
>
> OK, good... I'll think about whether it makes sense to add those locks.
> Actually, it probably makes sense to merge the __GFP_FS thing first,
> with a design that will allow further types to be added easily.
>
>
> > Nice feature - and we want more of this type of preventive dependency
> > tracking - so feel free to add it whenever you run into an example like
> > this.
>
> Well, lockdep has most of the support with iits "recusion possibility"
> checking for interrupts. All the names in the lockdep code are geared
> completely toward interrupts, but the concept is almost exactly the same
> here (I can't think if there are any other important points in the kernel
> where similar situation can arise, but it wouldn't surprise me if there
> is).
>
>
> > What merge route would you prefer? tip/core/locking would be the natural
> > home of it (we already have a fair bit of lockdep stuff queued up there
> > for v2.6.29) - it also touches a few FS bits.
>
> I'm happy for you or Peter to merge yet though there, sure. Just let me
> get some more input and then I'll try fix it up and make it merge
> worthy :)
>
> BTW. Do you have the might_lock annotations in there? I thought I'd see
> them in 2.6.28, but they don't seem to be there. No problems with them?
yes, they are still there, lined up for v2.6.29. They are working fine.
Ingo
prev parent reply other threads:[~2008-11-28 12:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-28 12:05 [rfc] lockdep: check fs reclaim recursion Nick Piggin
2008-11-28 12:11 ` Ingo Molnar
2008-11-28 12:21 ` Nick Piggin
2008-11-28 12:27 ` Ingo Molnar [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=20081128122715.GH18333@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/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).