From patchwork Thu Feb 9 20:11:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32953C636D7 for ; Thu, 9 Feb 2023 12:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbjBIML0 (ORCPT ); Thu, 9 Feb 2023 07:11:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbjBIMLN (ORCPT ); Thu, 9 Feb 2023 07:11:13 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 906FE4C31; Thu, 9 Feb 2023 04:09:21 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PCFyz2wPhz4f3l7J; Thu, 9 Feb 2023 20:09:15 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S3; Thu, 09 Feb 2023 20:09:17 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] blk-mq: sync wake_batch update and users number change Date: Fri, 10 Feb 2023 04:11:10 +0800 Message-Id: <20230209201116.579809-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S3 X-Coremail-Antispam: 1UD129KBjvJXoWxXF15ur4DGF17tryrAF4ktFb_yoW5WFyxpa y7ta17Kw1Fvry2qFW7JwsrXF4S9F4DKr13WrZaqa4rAw1Ykw1rur1kGrWkWrW0qr4kCr4x Aw47trZYyFsrAF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBYb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY020Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I 0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7IU0PPEDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Commit 180dccb0dba4f ("blk-mq: fix tag_get wait task can't be awakened") added recalculation of wake_batch when active_queues changes to avoid io hung. Function blk_mq_tag_idle and blk_mq_tag_busy can be called concurrently, then wake_batch maybe updated with old users number. For example, if tag alloctions for two shared queue happen concurrently, blk_mq_tag_busy maybe executed as following: thread1 thread2 atomic_inc_return atomic_inc_return blk_mq_update_wake_batch blk_mq_update_wake_batch 1.Thread1 adds active_queues from zero to one. 2.Thread2 adds active_queues from one to two. 3.Thread2 calculates wake_batch with latest active_queues number two. 4.Thread1 calculates wake_batch with stale active_queues number one. Then wake_batch is inconsistent with actual active_queues. If wake_batch is calculated with active_queues number smaller than actual active_queues number, wake_batch will be greater than it supposed to be and cause io hung. Sync wake_batch update and users number change to keep wake_batch consistent with active_queues to fix this. Fixes: 180dccb0dba4 ("blk-mq: fix tag_get wait task can't be awakened") Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara --- block/blk-mq-tag.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 9eb968e14d31..1d3135acfc98 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -39,7 +39,9 @@ static void blk_mq_update_wake_batch(struct blk_mq_tags *tags, */ void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) { + struct blk_mq_tags *tags = hctx->tags; unsigned int users; + unsigned long flags; if (blk_mq_is_shared_tags(hctx->flags)) { struct request_queue *q = hctx->queue; @@ -53,9 +55,11 @@ void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state); } - users = atomic_inc_return(&hctx->tags->active_queues); + spin_lock_irqsave(&tags->lock, flags); + users = atomic_inc_return(&tags->active_queues); - blk_mq_update_wake_batch(hctx->tags, users); + blk_mq_update_wake_batch(tags, users); + spin_unlock_irqrestore(&tags->lock, flags); } /* @@ -76,6 +80,7 @@ void __blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx) { struct blk_mq_tags *tags = hctx->tags; unsigned int users; + unsigned long flags; if (blk_mq_is_shared_tags(hctx->flags)) { struct request_queue *q = hctx->queue; @@ -88,9 +93,11 @@ void __blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx) return; } + spin_lock_irqsave(&tags->lock, flags); users = atomic_dec_return(&tags->active_queues); blk_mq_update_wake_batch(tags, users); + spin_unlock_irqrestore(&tags->lock, flags); blk_mq_tag_wakeup_all(tags, false); } From patchwork Thu Feb 9 20:11:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DD2FC6379F for ; Thu, 9 Feb 2023 12:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjBIML1 (ORCPT ); Thu, 9 Feb 2023 07:11:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjBIMLN (ORCPT ); Thu, 9 Feb 2023 07:11:13 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907A57A9B; Thu, 9 Feb 2023 04:09:21 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PCFyz5cttz4f3mJK; Thu, 9 Feb 2023 20:09:15 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S4; Thu, 09 Feb 2023 20:09:18 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] blk-mq: count changed hctx as active in blk_mq_get_tag Date: Fri, 10 Feb 2023 04:11:11 +0800 Message-Id: <20230209201116.579809-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S4 X-Coremail-Antispam: 1UD129KBjvJXoW7AFyUZw15ury7ZFy7XryUGFg_yoW8Xr4kp3 yrta1UKw1ftr4qvF48Gay7Zr1UKan7Wr45J3Z3Xw1rZryDK34Sgw4v9w18ta4FvrZ3CrW3 Zw1jkrW5tF98C37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBYb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I 0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7IUnwa9DUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Commit d263ed9926823 ("blk-mq: count the hctx as active before allocating tag") active hctx before blk_mq_get_tag to avoid petential starvation. However, the hctx to alloc tag may change in blk_mq_get_tag if BLK_MQ_REQ_NOWAIT is not set, then there are two problems: 1. The hctx without real allocation is marked active. 2. The starvation problem mentioned in Commit d263ed9926823 ("blk-mq: count the hctx as active before allocating tag") still exists on the changed hctx as it maybe not marked active before tag allocation. For problem 1, the hctx which is marked active probably gets IO soon or will be marked inactive after lazy detection of tag idle. Mark changed hctx active to fix problem 2. Fixes: d263ed992682 ("blk-mq: count the hctx as active before allocating tag") Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara --- block/blk-mq-tag.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 1d3135acfc98..e566fd96dc26 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -191,6 +191,9 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data) data->ctx = blk_mq_get_ctx(data->q); data->hctx = blk_mq_map_queue(data->q, data->cmd_flags, data->ctx); + if (!(data->rq_flags & RQF_ELV)) + blk_mq_tag_busy(data->hctx); + tags = blk_mq_tags_from_data(data); if (data->flags & BLK_MQ_REQ_RESERVED) bt = &tags->breserved_tags; From patchwork Thu Feb 9 20:11:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D3FBC636D3 for ; Thu, 9 Feb 2023 12:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbjBIML2 (ORCPT ); Thu, 9 Feb 2023 07:11:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjBIMLN (ORCPT ); Thu, 9 Feb 2023 07:11:13 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9091086A8; Thu, 9 Feb 2023 04:09:21 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFz02C9Lz4f3m6j; Thu, 9 Feb 2023 20:09:16 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S5; Thu, 09 Feb 2023 20:09:18 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] blk-mq: remove wake_batch recalculation for reserved tags Date: Fri, 10 Feb 2023 04:11:12 +0800 Message-Id: <20230209201116.579809-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S5 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4rWF45tr4xur13tF18Zrb_yoWkKFb_Wr 9rCa1ktFZ7ZFn3u3WjvF13trsYk3ykJry8Gan0qrZIkrn7JF95G390ka1FqFZxGFW8ur9x KF1kXw4jkrn7ujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfkYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r1rM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjxUIq2MUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Commit 180dccb0dba4f ("blk-mq: fix tag_get wait task can't be awakened") added wake_batch recalculation when user number of shared tags changes to avoid hung as user number increases, then hctx_max_depth limit for a single user decreases and may trigger hung if wake_batch > hctx_max_depth is met. Commit 285008501c65a ("blk-mq: always allow reserved allocation in hctx_may_queue") removed hctx_max_depth limit to alloc reserved tags, so hctx_max_depth limit for reserved tags is not exisiting anymore so we can remove recalculation for reserved tags. Fixes: 285008501c65 ("blk-mq: always allow reserved allocation in hctx_may_queue") Signed-off-by: Kemeng Shi --- block/blk-mq-tag.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index e566fd96dc26..7f1777dc11e5 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -27,8 +27,6 @@ static void blk_mq_update_wake_batch(struct blk_mq_tags *tags, sbitmap_queue_recalculate_wake_batch(&tags->bitmap_tags, users); - sbitmap_queue_recalculate_wake_batch(&tags->breserved_tags, - users); } /* From patchwork Thu Feb 9 20:11:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B5DDC636D3 for ; Thu, 9 Feb 2023 12:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230266AbjBIMLZ (ORCPT ); Thu, 9 Feb 2023 07:11:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjBIMLM (ORCPT ); Thu, 9 Feb 2023 07:11:12 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 905EF40FE; Thu, 9 Feb 2023 04:09:21 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFz04Pxbz4f3jZX; Thu, 9 Feb 2023 20:09:16 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S6; Thu, 09 Feb 2023 20:09:18 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] blk-mq: remove unnecessary bit clear in __blk_mq_alloc_requests_batch Date: Fri, 10 Feb 2023 04:11:13 +0800 Message-Id: <20230209201116.579809-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S6 X-Coremail-Antispam: 1UD129KBjvdXoW7XrWkZrWrurWrWFy8tw13urg_yoWxArX_W3 Wjkr1xZFZ8CF4fCrs0ka4rtr4jk395Ary2ka4kKrZIva1xJFn3ArsxWr4Ykwsxuay7C34r Gw1UXr18JF1ktjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjxUIL05UUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Bits in tag_mask will not be accessed after it's cleared. So we can remove this unnecessary clear. Signed-off-by: Kemeng Shi --- block/blk-mq.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 89b4dd81ae17..6014d9b5e296 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -456,7 +456,6 @@ __blk_mq_alloc_requests_batch(struct blk_mq_alloc_data *data, continue; tag = tag_offset + i; prefetch(tags->static_rqs[tag]); - tag_mask &= ~(1UL << i); rq = blk_mq_rq_ctx_init(data, tags, tag, alloc_time_ns); rq_list_add(data->cached_rq, rq); nr++; From patchwork Thu Feb 9 20:11:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF70DC64EC5 for ; Thu, 9 Feb 2023 12:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbjBIML3 (ORCPT ); Thu, 9 Feb 2023 07:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjBIMLO (ORCPT ); Thu, 9 Feb 2023 07:11:14 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD505B461; Thu, 9 Feb 2023 04:09:21 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFz074J6z4f3jZj; Thu, 9 Feb 2023 20:09:16 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S7; Thu, 09 Feb 2023 20:09:19 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] blk-mq: remove unnecessary "set->queue_depth == 0" check in blk_mq_alloc_set_map_and_rqs Date: Fri, 10 Feb 2023 04:11:14 +0800 Message-Id: <20230209201116.579809-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S7 X-Coremail-Antispam: 1UD129KBjvJXoW7ArWxAr47WF4xJw4fCrWrAFb_yoW8JF4kpr 4rJF1kGa4IgrsYkrW2kay7WF1jk398Wr4UJF4Sq345ArZrKrWa9F4rJF4jqryxZrZ3Cw4j 93y5K3yDXa1UGaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBIb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7IU0TqcUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org We will break the loop and set err to -ENOMEM if "set->queue_depth" is less than "set->reserved_tags + BLK_MQ_TAG_MIN". set->reserved_tags is unsigned int and should not be less than 0 logically. BLK_MQ_TAG_MIN is 1 and should be greater than 0 logically. So "set->reserved_tags + BLK_MQ_TAG_MIN" should be greater than 0. For case set->queue_depth is halved to zero, "set->queue_depth < set->reserved_tags + BLK_MQ_TAG_MIN" check is always met first, then this branch will set err to -ENOMEM and break the loop. Then the loop break condition "while(set->queue_depth)" is never met and set->queue_depth check in "if (!set->queue_depth || err)" is redundant. Just remove these checks. Signed-off-by: Kemeng Shi --- block/blk-mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 6014d9b5e296..4d2ab01549cd 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4324,9 +4324,9 @@ static int blk_mq_alloc_set_map_and_rqs(struct blk_mq_tag_set *set) err = -ENOMEM; break; } - } while (set->queue_depth); + } while (true); - if (!set->queue_depth || err) { + if (err) { pr_err("blk-mq: failed to allocate request map\n"); return -ENOMEM; } From patchwork Thu Feb 9 20:11:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 167FCC64EC6 for ; Thu, 9 Feb 2023 12:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229874AbjBIMLa (ORCPT ); Thu, 9 Feb 2023 07:11:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbjBIMLO (ORCPT ); Thu, 9 Feb 2023 07:11:14 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8BB2D41; Thu, 9 Feb 2023 04:09:22 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFz135z3z4f3m7G; Thu, 9 Feb 2023 20:09:17 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S8; Thu, 09 Feb 2023 20:09:19 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] blk-mq: Remove unnecessary hctx check in function blk_mq_alloc_and_init_hctx Date: Fri, 10 Feb 2023 04:11:15 +0800 Message-Id: <20230209201116.579809-7-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S8 X-Coremail-Antispam: 1UD129KBjvdXoWrZryDur47Ary3CF1kWFyUZFb_yoWxKrg_ua 4Ivr18XF4DAFyfCr4jka40yF17Crs5Xw12kryIkry7tF18GFyqkw4rWr15Z39xWFW7C393 Wr1kXry7Gr1fWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjxUIL05UUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org We can remove hctx from list when a valid hctx is found to avoid extra valid check. Signed-off-by: Kemeng Shi --- 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) From patchwork Thu Feb 9 20:11:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13134460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA7F8C61DA4 for ; Thu, 9 Feb 2023 12:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbjBIMLj (ORCPT ); Thu, 9 Feb 2023 07:11:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbjBIMLP (ORCPT ); Thu, 9 Feb 2023 07:11:15 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EEAED50B; Thu, 9 Feb 2023 04:09:23 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFz15pJ3z4f3m7Y; Thu, 9 Feb 2023 20:09:17 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFr4uRj4rAuDQ--.53349S9; Thu, 09 Feb 2023 20:09:19 +0800 (CST) From: Kemeng Shi To: axboe@kernel.dk, hch@lst.de, jack@suse.cz Cc: andriy.shevchenko@linux.intel.com, qiulaibin@huawei.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] blk-mq: remove stale comment of function called for iterated request Date: Fri, 10 Feb 2023 04:11:16 +0800 Message-Id: <20230209201116.579809-8-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209201116.579809-1-shikemeng@huaweicloud.com> References: <20230209201116.579809-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAHvrFr4uRj4rAuDQ--.53349S9 X-Coremail-Antispam: 1UD129KBjvJXoWxZrWUWFy7uF4fKw1fGryDWrg_yoWrCF4DpF Wava1vkr4Fqr1xCr4DA3y8Cr95urs3trnrGan3t34F9wn0krs5Xr4DKrW8Xr4jkF48uay8 Ars0y34kuw1DX3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBab4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x07jstxDUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org We call function with type "bool (busy_tag_iter_fn)(struct request *, void *)" for each iterated request now. Remove the stale arguments @hctx and @reserved in comment which are not needed by iterate function. Signed-off-by: Kemeng Shi --- block/blk-mq-tag.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 7f1777dc11e5..f1187c901019 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -303,9 +303,9 @@ static bool bt_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) * or the bitmap_tags member of struct blk_mq_tags. * @fn: Pointer to the function that will be called for each request * associated with @hctx that has been assigned a driver tag. - * @fn will be called as follows: @fn(@hctx, rq, @data, @reserved) - * where rq is a pointer to a request. Return true to continue - * iterating tags, false to stop. + * @fn will be called as follows: @fn(@rq, @data) where rq is a + * pointer to a request. Return true to continue iterating tags, + * false to stop. * @data: Will be passed as third argument to @fn. * @reserved: Indicates whether @bt is the breserved_tags member or the * bitmap_tags member of struct blk_mq_tags. @@ -372,9 +372,9 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) * @bt: sbitmap to examine. This is either the breserved_tags member * or the bitmap_tags member of struct blk_mq_tags. * @fn: Pointer to the function that will be called for each started - * request. @fn will be called as follows: @fn(rq, @data, - * @reserved) where rq is a pointer to a request. Return true - * to continue iterating tags, false to stop. + * request. @fn will be called as follows: @fn(rq, @data) where + * rq is a pointer to a request. Return true to continue + * iterating tags, false to stop. * @data: Will be passed as second argument to @fn. * @flags: BT_TAG_ITER_* */ @@ -407,10 +407,9 @@ static void __blk_mq_all_tag_iter(struct blk_mq_tags *tags, * blk_mq_all_tag_iter - iterate over all requests in a tag map * @tags: Tag map to iterate over. * @fn: Pointer to the function that will be called for each - * request. @fn will be called as follows: @fn(rq, @priv, - * reserved) where rq is a pointer to a request. 'reserved' - * indicates whether or not @rq is a reserved request. Return - * true to continue iterating tags, false to stop. + * request. @fn will be called as follows: @fn(rq, @priv) + * where rq is a pointer to a request. Return true to + * continue iterating tags, false to stop. * @priv: Will be passed as second argument to @fn. * * Caller has to pass the tag map from which requests are allocated. @@ -425,10 +424,9 @@ void blk_mq_all_tag_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn, * blk_mq_tagset_busy_iter - iterate over all started requests in a tag set * @tagset: Tag set to iterate over. * @fn: Pointer to the function that will be called for each started - * request. @fn will be called as follows: @fn(rq, @priv, - * reserved) where rq is a pointer to a request. 'reserved' - * indicates whether or not @rq is a reserved request. Return - * true to continue iterating tags, false to stop. + * request. @fn will be called as follows: @fn(rq, @priv) where + * rq is a pointer to a request. Return true to continue + * iterating tags, false to stop. * @priv: Will be passed as second argument to @fn. * * We grab one request reference before calling @fn and release it after @@ -484,10 +482,9 @@ EXPORT_SYMBOL(blk_mq_tagset_wait_completed_request); * blk_mq_queue_tag_busy_iter - iterate over all requests with a driver tag * @q: Request queue to examine. * @fn: Pointer to the function that will be called for each request - * on @q. @fn will be called as follows: @fn(hctx, rq, @priv, - * reserved) where rq is a pointer to a request and hctx points - * to the hardware queue associated with the request. 'reserved' - * indicates whether or not @rq is a reserved request. + * on @q. @fn will be called as follows: @fn(rq, @priv) where + * rq is a pointer to a request. Return true to continue + * iterating tags, false to stop. * @priv: Will be passed as third argument to @fn. * * Note: if @q->tag_set is shared with other request queues then @fn will be