Revision 8c0bec2151a47906bf779c6715a10ce04453ab77 authored by Jiaying Zhang on 31 August 2011, 15:50:51 UTC, committed by Theodore Ts'o on 31 August 2011, 15:50:51 UTC
The i_mutex lock and flush_completed_IO() added by commit 2581fdc810 in ext4_evict_inode() causes lockdep complaining about potential deadlock in several places. In most/all of these LOCKDEP complaints it looks like it's a false positive, since many of the potential circular locking cases can't take place by the time the ext4_evict_inode() is called; but since at the very least it may mask real problems, we need to address this. This change removes the flush_completed_IO() and i_mutex lock in ext4_evict_inode(). Instead, we take a different approach to resolve the software lockup that commit 2581fdc810 intends to fix. Rather than having ext4-dio-unwritten thread wait for grabing the i_mutex lock of an inode, we use mutex_trylock() instead, and simply requeue the work item if we fail to grab the inode's i_mutex lock. This should speed up work queue processing in general and also prevents the following deadlock scenario: During page fault, shrink_icache_memory is called that in turn evicts another inode B. Inode B has some pending io_end work so it calls ext4_ioend_wait() that waits for inode B's i_ioend_count to become zero. However, inode B's ioend work was queued behind some of inode A's ioend work on the same cpu's ext4-dio-unwritten workqueue. As the ext4-dio-unwritten thread on that cpu is processing inode A's ioend work, it tries to grab inode A's i_mutex lock. Since the i_mutex lock of inode A is still hold before the page fault happened, we enter a deadlock. Signed-off-by: Jiaying Zhang <jiayingz@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent fcb8ce5
File | Mode | Size |
---|---|---|
include | ||
.gitignore | -rw-r--r-- | 73 bytes |
Kconfig | -rw-r--r-- | 1023 bytes |
Makefile | -rw-r--r-- | 1.8 KB |
apparmorfs.c | -rw-r--r-- | 5.6 KB |
audit.c | -rw-r--r-- | 4.5 KB |
capability.c | -rw-r--r-- | 3.8 KB |
context.c | -rw-r--r-- | 5.4 KB |
domain.c | -rw-r--r-- | 21.2 KB |
file.c | -rw-r--r-- | 12.8 KB |
ipc.c | -rw-r--r-- | 3.1 KB |
lib.c | -rw-r--r-- | 3.3 KB |
lsm.c | -rw-r--r-- | 24.6 KB |
match.c | -rw-r--r-- | 8.9 KB |
path.c | -rw-r--r-- | 5.8 KB |
policy.c | -rw-r--r-- | 31.5 KB |
policy_unpack.c | -rw-r--r-- | 16.6 KB |
procattr.c | -rw-r--r-- | 4.6 KB |
resource.c | -rw-r--r-- | 3.9 KB |
sid.c | -rw-r--r-- | 1.2 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...