lkml.org 
[lkml]   [2023]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6/7] blk-mq: Remove unnecessary hctx check in function blk_mq_alloc_and_init_hctx
    Date
    We can remove hctx from list when a valid hctx is found to avoid
    extra valid check.

    Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
    ---
    block/blk-mq.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/block/blk-mq.c b/block/blk-mq.c
    index 4d2ab01549cd..1aa3cdc55c4e 100644
    --- a/block/blk-mq.c
    +++ b/block/blk-mq.c
    @@ -4121,11 +4121,10 @@ static struct blk_mq_hw_ctx *blk_mq_alloc_and_init_hctx(
    list_for_each_entry(tmp, &q->unused_hctx_list, hctx_list) {
    if (tmp->numa_node == node) {
    hctx = tmp;
    + list_del_init(&hctx->hctx_list);
    break;
    }
    }
    - if (hctx)
    - list_del_init(&hctx->hctx_list);
    spin_unlock(&q->unused_hctx_lock);

    if (!hctx)
    --
    2.30.0
    \
     
     \ /
      Last update: 2023-03-27 00:16    [W:2.489 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site