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
Raw File
d102e_ucode.bin.ihex
:100000008F027D00F904420E850CED14E914FA14F8
:10001000360EF70EFF1FFF1FB914E00000000000AE
:100020000000000000000000BD14E000000000001F
:100030000000000000000000D514E00000000000F7
:1000400000000000000000000000000000000000B0
:100050000000000000000000C114E00000000000EB
:100060000000000000000000000000000000000090
:100070000000000000000000000000000000000080
:100080000000000000000000000000000000000070
:100090000000000000000000C814E00000000000A4
:1000A000000000000000000000062000EE14E00048
:1000B000000000000000000080FF3000460E9400A9
:1000C0000082030000201000430EE000000000004A
:1000D000000000000000000006003000FB14E000FB
:1000E0000000000000000000000000000000000010
:1000F0000000000000000000000000000000000000
:1001000000000000000000000000000000000000EF
:100110000000000000000000416E90003C0E8000D6
:10012000390EE00000000000FD6E9000FD0E900012
:10013000F80EE000000000000000000000000000D9
:1001400000000000000000000000000000000000AF
:10015000000000000000000000000000000000009F
:10016000000000000000000000000000000000008F
:10017000000000000000000000000000000000007F
:10018000000000000000000000000000000000006F
:10019000000000000000000000000000000000005F
:1001A000000000000000000000000000000000004F
:1001B000000000000000000000000000000000003F
:1001C000000000000000000000000000000000002F
:1001D000000000000000000000000000000000001F
:1001E000000000000000000000000000000000000F
:1001F00000000000000000000000000000000000FF
:1002000000000000000000000000000000000000EE
:0B02100000000000000000002A362E55
:00000001FF
/********************************************************/
/*  Micro code for the 8086:1229 Rev F/10               */
/********************************************************/
back to top