mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Zach Brown <zach.brown@oracle.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	linux-aio@kvack.org, Chris Mason <chris.mason@oracle.com>
Subject: Re: dio_get_page() lockdep complaints
Date: Fri, 09 Nov 2007 12:45:00 -0500	[thread overview]
Message-ID: <1194630300.7459.65.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <4734992C.7000408@oracle.com>


On Fri, 2007-11-09 at 09:30 -0800, Zach Brown wrote:
> So, reiserfs and NFS are nesting i_mutex inside the mmap_sem.
> 
> >>        [<b038c6e5>] mutex_lock+0x1c/0x1f
> >>        [<b01b17e9>] reiserfs_file_release+0x54/0x447
> >>        [<b016afe7>] __fput+0x53/0x101
> >>        [<b016b0ee>] fput+0x19/0x1c
> >>        [<b015bcd5>] remove_vma+0x3b/0x4d
> >>        [<b015c659>] do_munmap+0x17f/0x1cf
> 
> >        [<ffffffff802686a1>] _mutex_lock+0x28/0x34
> >        [<ffffffff883e71d0>] nfs_revalidate_mapping+0x6d/0xac [nfs]
> >        [<ffffffff883e4b51>] nfs_file_mmap+0x5c/0x74 [nfs]
> >        [<ffffffff8020df7e>] do_mmap_pgoff+0x51a/0x817
> >        [<ffffffff80225d19>] sys_mmap+0x90/0x119
> 
> I think i_mutex is fundamentally nested outside of the mmap_sem because
> of faulting in the buffered write path.  I think these warnings could be
> reproduced with a careful test app which tries buffered writes from an
> address which will fault.
> 
> DIO just tripped it up because it *always* performs get_user_pages() on
> the memory.
> 
> So reiser and NFS need to be fixed.  No?

Actually, it is rather mmap() needs to be fixed. It is cold calling the
filesystem while holding all sorts of nasty locks. It needs to be
migrated to the same sort of syscall layout as read() and write().

You _first_ call the filesystem so that it can make whatever
preparations it needs outside the lock. The filesystem then calls the
VM, which can then call the filesystem back if needed.

Trond


  reply	other threads:[~2007-11-09 17:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-19  7:38 Jens Axboe
2007-04-19  8:01 ` Andrew Morton
2007-04-19  8:01   ` Jens Axboe
2007-04-19  8:25     ` Andrew Morton
2007-04-19  8:34       ` Jens Axboe
2007-04-19 12:43         ` Vladimir V. Saveliev
2007-04-19 12:49           ` Jens Axboe
2007-04-19 12:52             ` Jens Axboe
2007-04-19 13:53               ` Roland Dreier
2007-04-19 14:20                 ` Jens Axboe
2007-04-19 14:15         ` Jens Axboe
2007-04-19 14:55           ` Vladimir V. Saveliev
2007-04-19 14:57       ` Vladimir V. Saveliev
2007-04-19 16:42         ` Andrew Morton
2007-04-19 14:36   ` Chris Mason
2007-11-09 17:02 ` Peter Zijlstra
2007-11-09 17:30   ` Zach Brown
2007-11-09 17:45     ` Trond Myklebust [this message]
2007-11-09 17:48       ` Zach Brown
2007-11-09 18:01         ` Chris Mason
2007-11-09 18:35           ` Zach Brown
2007-11-09 18:53             ` Chris Mason
2007-11-09 18:57               ` Chris Mason
2007-11-09 19:16                 ` Zach Brown
2007-11-09 19:35                   ` Chris Mason
2007-11-11 19:49       ` Peter Zijlstra
2007-11-12  8:45         ` Martin Schwidefsky
2007-11-12  9:27           ` Peter Zijlstra

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=1194630300.7459.65.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=akpm@linux-foundation.org \
    --cc=chris.mason@oracle.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=zach.brown@oracle.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

all inboxes | Powered by JetHome®