• Paolo Valente's avatar
    block, bfq: remove all get and put of I/O contexts · 6fa3e8d3
    Paolo Valente authored
    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: default avatarPaolo Valente <paolo.valente@linaro.org>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    6fa3e8d3
bfq-iosched.c 266 KB