The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* deadlocks caused by ext3/reiser dirty_inode calls during do_mmap_pgoff
@ 2004-06-21 16:59 Chris Mason
  2004-06-22  0:13 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Mason @ 2004-06-21 16:59 UTC (permalink / raw)
  To: linux-kernel

Hello everyone,

do_mmap_pgoff is called with a write lock on mmap_sem, and can trigger
calls to generic_file_mmap, which calls file_accessed to update the
atime on the file.

For reiserfs, this might start a transaction, which might have to wait
for the currently running transaction to finish.  It looks like ext3 may
do the same thing, but I'm not 100% sure on that.

If the currently running transaction happens to by running
copy_from_user, like we do during write calls, it might be trying to get
a hold of a read lock on the mmap sem while trying to hand page faults.

This is effectively a lock inversion problem, and deadlocks.  There's a
few choices:

1) don't start a transaction during atime updates.
2) don't update the atime until after we drop the mmap_sem.

Anyone have other ideas?

-chris



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-06-25 17:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-21 16:59 deadlocks caused by ext3/reiser dirty_inode calls during do_mmap_pgoff Chris Mason
2004-06-22  0:13 ` Andrew Morton
2004-06-22 14:13   ` Chris Mason
2004-06-22 18:57     ` Andrew Morton
2004-06-22 20:32       ` Chris Mason
2004-06-22 14:43   ` Chris Mason
2004-06-22 19:05     ` Andrew Morton
2004-06-22 20:41       ` Chris Mason
2004-06-25 17:59       ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox