• Jens Axboe's avatar
    block: have plug stored requests hold references to the queue · c5fc7b93
    Jens Axboe authored
    Requests that were stored in the cache deliberately didn't hold an enter
    reference to the queue, instead we grabbed one every time we pulled a
    request out of there. That made for awkward logic on freeing the remainder
    of the cached list, if needed, where we had to artificially raise the
    queue usage count before each free.
    
    Grab references up front for cached plug requests. That's safer, and also
    more efficient.
    
    Fixes: 47c122e3 ("block: pre-allocate requests if plug is started and is a batch")
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    c5fc7b93
blk-mq.c 107 KB