diff options
| author | Guoju Fang <fangguoju@gmail.com> | 2019-11-13 16:03:16 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-01 13:17:18 +0200 |
| commit | fd3572bd5bc1c18512a44d4e73ea39af957dc658 (patch) | |
| tree | c5fe9f4c5cb53cb00c0f58319dec6752abdaede6 /drivers/dma | |
| parent | 9f81aa5d44932c7c183b873ae0192bf0df232ffc (diff) | |
| download | linux-fd3572bd5bc1c18512a44d4e73ea39af957dc658.tar.gz linux-fd3572bd5bc1c18512a44d4e73ea39af957dc658.tar.bz2 linux-fd3572bd5bc1c18512a44d4e73ea39af957dc658.zip | |
bcache: fix a lost wake-up problem caused by mca_cannibalize_lock
[ Upstream commit 34cf78bf34d48dddddfeeadb44f9841d7864997a ]
This patch fix a lost wake-up problem caused by the race between
mca_cannibalize_lock and bch_cannibalize_unlock.
Consider two processes, A and B. Process A is executing
mca_cannibalize_lock, while process B takes c->btree_cache_alloc_lock
and is executing bch_cannibalize_unlock. The problem happens that after
process A executes cmpxchg and will execute prepare_to_wait. In this
timeslice process B executes wake_up, but after that process A executes
prepare_to_wait and set the state to TASK_INTERRUPTIBLE. Then process A
goes to sleep but no one will wake up it. This problem may cause bcache
device to dead.
Signed-off-by: Guoju Fang <fangguoju@gmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/dma')
0 files changed, 0 insertions, 0 deletions
