From: Andi Kleen <andi@firstfloor.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>, f@basil.fritz.box
Cc: Andi Kleen <andi@firstfloor.org>,
Al Viro <viro@ZenIV.linux.org.uk>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
linux-kernel@vger.kernel.org
Subject: Re: NFS lockdep lock misordering mmap_sem<->i_mutex_key with 2.6.32-git1
Date: Wed, 16 Dec 2009 16:57:14 +0100 [thread overview]
Message-ID: <20091216155714.GF15031@basil.fritz.box> (raw)
In-Reply-To: <1260968991.3219.57.camel@localhost>
On Wed, Dec 16, 2009 at 08:09:51AM -0500, Trond Myklebust wrote:
> On Wed, 2009-12-16 at 01:53 +0100, Andi Kleen wrote:
> > > If you want to work around the problem rather than going for something
> >
> > I am mostly interested in making the ugly warning on my systems
> > go away, preferably without breaking anything in the process.
> > Whatever works.
> >
> > > like Peter's split up of the mmap() callback, then I'd suggest changing
> > > to using nfs_revalidate_mapping_nolock() instead. The fact that we are
> > > seeing these lock misordering warnings is proof that the call to
> > > nfs_revalidate_mapping() is not always a no-op.
> >
> > I would say the interesting question is if there is really a expectation
> > that mmap does this kind of synchronization?
>
> Usually people who set the 'noac' mount flag will expect these syscalls
> to act as synchronisation points.
It would be definitely a synchronization point if they deadlock in
mmap due to a ABBA race.
> Typically, their applications will be using some kind of locking scheme
> that does not require POSIX or BSD locks to be set. For instance, they
> may synchronise by means of a token passed through a socket (common in
> MPI iirc).
Still mmap seems like an odd synchronization point. Is not doing it
in it really likely to break anything?
> > Why in mmap, not somewhere else?
>
> We do the same thing in the read() and write() syscalls.
Ok I didn't fully understand your suggestion to use the _nolock
variant. Are you saying i_mutex is sometimes not needed?
I thought _nolock was only for the case i_mutex is already hold --
which is not the case here.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2009-12-16 15:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-07 11:59 NFS lockdep lock misordering mmap_sem<->i_mutex_key with 2.6.32-git1 Andi Kleen
2009-12-07 12:19 ` KOSAKI Motohiro
2009-12-07 13:20 ` Andi Kleen
2009-12-07 17:38 ` KOSAKI Motohiro
2009-12-15 22:21 ` Al Viro
2009-12-15 23:38 ` Andi Kleen
2009-12-15 23:54 ` Trond Myklebust
2009-12-16 0:09 ` Al Viro
2009-12-16 13:16 ` Trond Myklebust
2009-12-23 16:32 ` Andi Kleen
2009-12-16 0:53 ` Andi Kleen
2009-12-16 13:09 ` Trond Myklebust
2009-12-16 15:57 ` Andi Kleen [this message]
2009-12-16 0:06 ` KOSAKI Motohiro
2009-12-16 0:48 ` Andi Kleen
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=20091216155714.GF15031@basil.fritz.box \
--to=andi@firstfloor.org \
--cc=f@basil.fritz.box \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
--cc=viro@ZenIV.linux.org.uk \
/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