[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1194630300.7459.65.camel@heimdal.trondhjem.org>
Date: Fri, 09 Nov 2007 12:45:00 -0500
From: Trond Myklebust <trond.myklebust@....uio.no>
To: Zach Brown <zach.brown@...cle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Jens Axboe <jens.axboe@...cle.com>,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
linux-aio@...ck.org, Chris Mason <chris.mason@...cle.com>
Subject: Re: dio_get_page() lockdep complaints
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists