From: "Krzysztof Helt" <krzysztof.h1@wp.pl>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
jfs-discussion <jfs-discussion@lists.sourceforge.net>
Subject: Re: [Jfs-discussion] [PATCH] jfs: lockdep fix
Date: Wed, 21 Oct 2009 08:24:27 +0200 [thread overview]
Message-ID: <4adea91bbfcf65.02080900@wp.pl> (raw)
In-Reply-To: <4ade05f0af05a2.00981454@wp.pl> <1256068823.3708.30.camel@norville.austin.ibm.com>
Dnia 20-10-2009 o godz. 22:00 Dave Kleikamp napisał(a):
> On Tue, 2009-10-20 at 20:48 +0200, Krzysztof Helt wrote:
> > From: Krzysztof Helt <krzysztof.h1@wp.pl>
> >
> > Release rdwrlock semaphore during memory allocation.
> > This fixes the locked already reported here:
> >
> > http://www.mail-archive.com/jfs-discussion@lists.sourceforge.net/msg01389.html
> >
> > The problem here is that memory allocation is done with rdwrlock
> > semaphore taken and the VM can get into the jfs layer taking the
> > rdwrlock again.
> >
> > Also, the patch fixes the lockdep below. This problem is created because
> > the rdwrlock semaphore acquires the commit_mutex and it is called with
> > interrupts enabled. The interrupt may hit with the commit_mutex taken
> > and take the rdwrlock (again) inside the interrupt context.
>
> The rdwrlock should never be taken in interrupt context.
>
Right. It is taken in the RECLAIM_FS context.
> > =========================================================
> > [ INFO: possible irq lock inversion dependency detected ]
> > 2.6.32-rc3 #99
> > ---------------------------------------------------------
> > kswapd0/180 just changed the state of lock:
> > (&jfs_ip->rdwrlock#2){++++-.}, at: [<c02e2207>] jfs_get_block+0x47/0x280
> > but this lock took another, RECLAIM_FS-unsafe lock in the past:
> > (&jfs_ip->commit_mutex){+.+.+.}
> >
> > and interrupts could create inverse lock ordering between them.
> >
> >
> > other info that might help us debug this:
> > no locks held by kswapd0/180.
> >
> > the shortest dependencies between 2nd lock and 1st lock:
> > -> (&jfs_ip->commit_mutex){+.+.+.} ops: 7937 {
> > HARDIRQ-ON-W at:
>
> <snip>
>
> > ---
> >
> > I am not sure if this is the right fix to the problem. The heavy use of
> > the jfs volume can lock up a machine (e.g. hit me in Ubuntu 9.04).
>
> I don't think we can just drop the mutex, since it protects the inode's
> xtree from being modified while another thread is either reading or
> writing it.
>
> I proposed another fix here:
> http://bugzilla.kernel.org/show_bug.cgi?id=13613
>
> It seems I haven't followed up and submitted it to the vfs maintainer.
> Could you please give that patch a try and see if it fixes the problem
> for you?
>
I have tested it a little and I will do some more. At least, there is no
easy way to trigger the previous lockdep (with rdwrlock only reported to
the 2.6.30). It seems your fix helps here.
However, I think it does not help with this new lockdep I have reported.
The new locked is due to the fact that commit_mutex is taken with the
rdwrlock hold and enabled interrupts. The kswapd may start and create
the inverse locking order. The kswapd takes the rdwrlock and some other
task may hold the commit_mutex. The rdwrlock is taken in jfs_get_block()
and calls the extAlloc() which takes the commit_mutex. One possible fix
is to move the commit mutex to the jfs_get_block() before the rdwrlock.
The extAlloc() is called from the jfs_get_block() only.
Kind regards,
Krzysztof
----------------------------------------------------
WYGRAJ wycieczkę kolejową po północnej Hiszpanii!
http://klik.wp.pl/?adr=http%3A%2F%2Fwww.navigeo.pl%2Fcontest%2Fidea_tour&sid=885
next prev parent reply other threads:[~2009-10-21 6:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 18:48 [PATCH] jfs: lockdep fix Krzysztof Helt
2009-10-20 20:00 ` [Jfs-discussion] " Dave Kleikamp
2009-10-21 6:24 ` Krzysztof Helt [this message]
2009-10-21 18:25 ` Krzysztof Helt
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=4adea91bbfcf65.02080900@wp.pl \
--to=krzysztof.h1@wp.pl \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=shaggy@linux.vnet.ibm.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