aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorJunxiao Bi <[email protected]>2019-07-10 00:17:19 +0000
committerMike Snitzer <[email protected]>2019-07-12 13:59:37 +0000
commitbd293d071ffe65e645b4d8104f9d8fe15ea13862 (patch)
tree29faa2ee05ac191581222287a36886738e33ef00 /tools/perf/scripts/python
parentdm snapshot: add optional discard support features (diff)
downloadkernel-bd293d071ffe65e645b4d8104f9d8fe15ea13862.tar.gz
kernel-bd293d071ffe65e645b4d8104f9d8fe15ea13862.zip
dm bufio: fix deadlock with loop device
When thin-volume is built on loop device, if available memory is low, the following deadlock can be triggered: One process P1 allocates memory with GFP_FS flag, direct alloc fails, memory reclaim invokes memory shrinker in dm_bufio, dm_bufio_shrink_scan() runs, mutex dm_bufio_client->lock is acquired, then P1 waits for dm_buffer IO to complete in __try_evict_buffer(). But this IO may never complete if issued to an underlying loop device that forwards it using direct-IO, which allocates memory using GFP_KERNEL (see: do_blockdev_direct_IO()). If allocation fails, memory reclaim will invoke memory shrinker in dm_bufio, dm_bufio_shrink_scan() will be invoked, and since the mutex is already held by P1 the loop thread will hang, and IO will never complete. Resulting in ABBA deadlock. Cc: [email protected] Signed-off-by: Junxiao Bi <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions