[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230209201116.579809-7-shikemeng@huaweicloud.com>
Date: Fri, 10 Feb 2023 04:11:15 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: axboe@...nel.dk, hch@....de, jack@...e.cz
Cc: andriy.shevchenko@...ux.intel.com, qiulaibin@...wei.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 6/7] blk-mq: Remove unnecessary hctx check in function blk_mq_alloc_and_init_hctx
We can remove hctx from list when a valid hctx is found to avoid
extra valid check.
Signed-off-by: Kemeng Shi <shikemeng@...weicloud.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
Powered by blists - more mailing lists