Revision 3b6b7813b198b578aa7e04e4047ddb8225c37b7f authored by Mikulas Patocka on 20 March 2013, 17:21:25 UTC, committed by Alasdair G Kergon on 20 March 2013, 17:21:25 UTC
A deadlock was found in the prefetch code in the dm verity map function. This patch fixes this by transferring the prefetch to a worker thread and skipping it completely if kmalloc fails. If generic_make_request is called recursively, it queues the I/O request on the current->bio_list without making the I/O request and returns. The routine making the recursive call cannot wait for the I/O to complete. The deadlock occurs when one thread grabs the bufio_client mutex and waits for an I/O to complete but the I/O is queued on another thread's current->bio_list and is waiting to get the mutex held by the first thread. The fix recognises that prefetching is not essential. If memory can be allocated, it queues the prefetch request to the worker thread, but if not, it does nothing. Signed-off-by: Paul Taysom <taysom@chromium.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: stable@kernel.org
1 parent 58051b9
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 16.0 KB |
Kconfig.debug | -rw-r--r-- | 1015 bytes |
Makefile | -rw-r--r-- | 2.0 KB |
backing-dev.c | -rw-r--r-- | 21.5 KB |
balloon_compaction.c | -rw-r--r-- | 9.6 KB |
bootmem.c | -rw-r--r-- | 21.3 KB |
bounce.c | -rw-r--r-- | 7.5 KB |
cleancache.c | -rw-r--r-- | 6.5 KB |
compaction.c | -rw-r--r-- | 32.3 KB |
debug-pagealloc.c | -rw-r--r-- | 2.1 KB |
dmapool.c | -rw-r--r-- | 13.1 KB |
fadvise.c | -rw-r--r-- | 4.0 KB |
failslab.c | -rw-r--r-- | 1.3 KB |
filemap.c | -rw-r--r-- | 67.3 KB |
filemap_xip.c | -rw-r--r-- | 11.3 KB |
fremap.c | -rw-r--r-- | 6.8 KB |
frontswap.c | -rw-r--r-- | 10.3 KB |
highmem.c | -rw-r--r-- | 9.9 KB |
huge_memory.c | -rw-r--r-- | 72.9 KB |
hugetlb.c | -rw-r--r-- | 82.3 KB |
hugetlb_cgroup.c | -rw-r--r-- | 10.7 KB |
hwpoison-inject.c | -rw-r--r-- | 3.3 KB |
init-mm.c | -rw-r--r-- | 619 bytes |
internal.h | -rw-r--r-- | 11.1 KB |
interval_tree.c | -rw-r--r-- | 3.2 KB |
kmemcheck.c | -rw-r--r-- | 2.8 KB |
kmemleak-test.c | -rw-r--r-- | 3.3 KB |
kmemleak.c | -rw-r--r-- | 52.4 KB |
ksm.c | -rw-r--r-- | 65.9 KB |
maccess.c | -rw-r--r-- | 1.6 KB |
madvise.c | -rw-r--r-- | 14.1 KB |
memblock.c | -rw-r--r-- | 29.6 KB |
memcontrol.c | -rw-r--r-- | 180.4 KB |
memory-failure.c | -rw-r--r-- | 44.3 KB |
memory.c | -rw-r--r-- | 114.4 KB |
memory_hotplug.c | -rw-r--r-- | 46.6 KB |
mempolicy.c | -rw-r--r-- | 71.3 KB |
mempool.c | -rw-r--r-- | 10.5 KB |
migrate.c | -rw-r--r-- | 43.7 KB |
mincore.c | -rw-r--r-- | 7.8 KB |
mlock.c | -rw-r--r-- | 14.9 KB |
mm_init.c | -rw-r--r-- | 4.0 KB |
mmap.c | -rw-r--r-- | 81.8 KB |
mmu_context.c | -rw-r--r-- | 1.4 KB |
mmu_notifier.c | -rw-r--r-- | 9.3 KB |
mmzone.c | -rw-r--r-- | 2.4 KB |
mprotect.c | -rw-r--r-- | 10.2 KB |
mremap.c | -rw-r--r-- | 14.4 KB |
msync.c | -rw-r--r-- | 2.4 KB |
nobootmem.c | -rw-r--r-- | 11.0 KB |
nommu.c | -rw-r--r-- | 51.5 KB |
oom_kill.c | -rw-r--r-- | 19.5 KB |
page-writeback.c | -rw-r--r-- | 70.0 KB |
page_alloc.c | -rw-r--r-- | 170.6 KB |
page_cgroup.c | -rw-r--r-- | 11.9 KB |
page_io.c | -rw-r--r-- | 6.8 KB |
page_isolation.c | -rw-r--r-- | 7.0 KB |
pagewalk.c | -rw-r--r-- | 5.7 KB |
percpu-km.c | -rw-r--r-- | 2.8 KB |
percpu-vm.c | -rw-r--r-- | 12.9 KB |
percpu.c | -rw-r--r-- | 57.1 KB |
pgtable-generic.c | -rw-r--r-- | 4.6 KB |
process_vm_access.c | -rw-r--r-- | 13.2 KB |
quicklist.c | -rw-r--r-- | 2.4 KB |
readahead.c | -rw-r--r-- | 16.1 KB |
rmap.c | -rw-r--r-- | 50.4 KB |
shmem.c | -rw-r--r-- | 77.2 KB |
slab.c | -rw-r--r-- | 117.7 KB |
slab.h | -rw-r--r-- | 6.2 KB |
slab_common.c | -rw-r--r-- | 11.1 KB |
slob.c | -rw-r--r-- | 15.3 KB |
slub.c | -rw-r--r-- | 129.0 KB |
sparse-vmemmap.c | -rw-r--r-- | 5.9 KB |
sparse.c | -rw-r--r-- | 20.9 KB |
swap.c | -rw-r--r-- | 23.3 KB |
swap_state.c | -rw-r--r-- | 10.7 KB |
swapfile.c | -rw-r--r-- | 65.6 KB |
truncate.c | -rw-r--r-- | 18.3 KB |
util.c | -rw-r--r-- | 9.6 KB |
vmalloc.c | -rw-r--r-- | 66.1 KB |
vmscan.c | -rw-r--r-- | 100.2 KB |
vmstat.c | -rw-r--r-- | 33.9 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...