diff options
author | Chao Yu <[email protected]> | 2021-01-11 17:42:53 +0800 |
---|---|---|
committer | Jaegeuk Kim <[email protected]> | 2021-01-27 15:20:05 -0800 |
commit | 3afae09ffea5e08f523823be99a784675995d6bb (patch) | |
tree | 058c9900cfbaf6358cf07d7fbb83233848108247 /tools/perf/util/scripting-engines/trace-event-perl.c | |
parent | 794c43f716845e2d48ce195ed5c4179a4e05ce5f (diff) |
f2fs: compress: fix potential deadlock
generic/269 reports a hangtask issue, the root cause is ABBA deadlock
described as below:
Thread A Thread B
- down_write(&sbi->gc_lock) -- A
- f2fs_write_data_pages
- lock all pages in cluster -- B
- f2fs_write_multi_pages
- f2fs_write_raw_pages
- f2fs_write_single_data_page
- f2fs_balance_fs
- down_write(&sbi->gc_lock) -- A
- f2fs_gc
- do_garbage_collect
- ra_data_block
- pagecache_get_page -- B
To fix this, it needs to avoid calling f2fs_balance_fs() if there is
still cluster pages been locked in context of cluster writeback, so
instead, let's call f2fs_balance_fs() in the end of
f2fs_write_raw_pages() when all cluster pages were unlocked.
Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
0 files changed, 0 insertions, 0 deletions