• NeilBrown's avatar
    Revert "MD: fix lock contention for flush bios" · 2fc0111f
    NeilBrown authored
    commit 4bc034d3 upstream.
    
    This reverts commit 5a409b4f.
    
    This patch has two problems.
    
    1/ it make multiple calls to submit_bio() from inside a make_request_fn.
     The bios thus submitted will be queued on current->bio_list and not
     submitted immediately.  As the bios are allocated from a mempool,
     this can theoretically result in a deadlock - all the pool of requests
     could be in various ->bio_list queues and a subsequent mempool_alloc
     could block waiting for one of them to be released.
    
    2/ It aims to handle a case when there are many concurrent flush requests.
      It handles this by submitting many requests in parallel - all of which
      are identical and so most of which do nothing useful.
      It would be more efficient to just send one lower-level request, but
      allow that to satisfy multiple upper-level requests.
    
    Fixes: 5a409b4f ("MD: fix lock contention for flush bios")
    Cc: <stable@vger.kernel.org> # v4.19+
    Tested-by: default avatarXiao Ni <xni@redhat.com>
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    2fc0111f
md.c 246 KB