OSDN Git Service

block, bfq: remove all get and put of I/O contexts
authorPaolo Valente <paolo.valente@linaro.org>
Wed, 12 Apr 2017 16:23:21 +0000 (18:23 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 19 Apr 2017 14:30:26 +0000 (08:30 -0600)
commit6fa3e8d34204d532268ddb4dc5d2a904197c972d
tree8c94a1696e1f0cf46c69107caf1f936dc4695599
parente1b2324dd065880a3200098fe3637ac171c296e6
block, bfq: remove all get and put of I/O contexts

When a bfq queue is set in service and when it is merged, a reference
to the I/O context associated with the queue is taken. This reference
is then released when the queue is deselected from service or
split. More precisely, the release of the reference is postponed to
when the scheduler lock is released, to avoid nesting between the
scheduler and the I/O-context lock. In fact, such nesting would lead
to deadlocks, because of other code paths that take the same locks in
the opposite order. This postponing of I/O-context releases does
complicate code.

This commit addresses these issue by modifying involved operations in
such a way to not need to get the above I/O-context references any
more. Then it also removes any get and release of these references.

Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/bfq-iosched.c