[lkml]   [2011]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: INFO: possible circular locking dependency detected 3.1.0-rc2-00190-g3210d19
On Mon, Aug 22, 2011 at 09:33:34AM -0400, Josh Boyer wrote:

> So the lockdep report in the RHBZ (which now that I look at it
> probably isn't the same as this report) seems to be doing a readdir
> while find is trying to mmap, which is calling into
> hugetlbfs_file_mmap and throwing the same deadlock warning. Is that
> like the scenario you are describing above?

Lockdep records the first trace that leads to locks taken in this
order. readdir() seems to be the first thing to step on i_mutex
and mmap_sem (not too surprisingly, come to think of that - directory
reads happening earlier in the boot than regular file writes).

So when it reports i_mutex taken under mmap_sem, readdir gets mentioned
by lockdep. Often leading to comments along the lines of "but this
inode is not a directory at all; shouldn't we relax the rules for
non-directories?" Nope; the same ordering very much applies to regular
files. With s/readdir/write/.

The bottom line is: don't take i_mutex while holding mmap_sem. Really.

 \ /
  Last update: 2011-08-22 15:59    [W:0.087 / U:0.376 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site