]> git.baikalelectronics.ru Git - kernel.git/commit
block: remove retry loop in ioc_release_fn()
authorJohn Ogness <john.ogness@linutronix.de>
Fri, 19 Jun 2020 15:17:18 +0000 (17:23 +0206)
committerJens Axboe <axboe@kernel.dk>
Thu, 16 Jul 2020 16:22:15 +0000 (10:22 -0600)
commit0c972cde9adc99a6064f5074d3cb06e3e6719564
tree966c1f220ecc02124e43ec877d6808304c8f0e4e
parent59211bc8c1330f6bf6f21188424967836c3ab5e5
block: remove retry loop in ioc_release_fn()

The reverse-order double lock dance in ioc_release_fn() is using a
retry loop. This is a problem on PREEMPT_RT because it could preempt
the task that would release q->queue_lock and thus live lock in the
retry loop.

RCU is already managing the freeing of the request queue and icq. If
the trylock fails, use RCU to guarantee that the request queue and
icq are not freed and re-acquire the locks in the correct order,
allowing forward progress.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-ioc.c