From patchwork Wed Sep 13 03:50:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 138750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp1013394vqx; Wed, 13 Sep 2023 04:27:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/5Xh1A10Zv3G6dtF7Jw4xHPu/OQlK3Uq1sAwAJuJ4EzL3v6zhRzzJsNp2WRlw4/is5w6F X-Received: by 2002:a17:902:ce88:b0:1bc:2fe1:1821 with SMTP id f8-20020a170902ce8800b001bc2fe11821mr7767401plg.17.1694604442467; Wed, 13 Sep 2023 04:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694604442; cv=none; d=google.com; s=arc-20160816; b=rJDJ600XcrE5vM4+8tLIoiyDYElNhHKH8pbu22xdKd8beeKqJumT3MR3M45qoI6uCz nl+Zqiq8c4/wpr0JceUueIRGBGl+QQX+MRtrCiHIiF+DYa4AY4lgOuHap3tcBfJ6GUVi 4adGDxwG3I1ig9jBFER0CSR/HLWJv3fblYtqjo6+XxYOFym8JS5e2F/Ou1UuYziXhMjf Nv6BsA0joIA9+ypNuOJL6Lo8HNqFulyCGeEAEXUGCuLSTGNdjbXQiuOkTXY9hvDa+l7u mhg3gxpCG8z2CdT0NfCrIJztFyCOBxCajCpfTkK7/ofRDcosNhXVezAvWM//xVKhMAtW W0lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Wk0aXTAElE79+EX7YkShEQJOBh1Ww7m9AhWaKXcP+HU=; fh=0kSCNnJ+Dz7/k19JqdLGTHBnZxdhAtg5C+lF7soNwhs=; b=yD0+Iysi6R6is3kX/eLEKOunP6NpAkp02lYVghUX/uCe5fvbfEezHMYJMxPAgwF2TW xNhMp40Aj4TDvdOoQTBMxJVpjCZ/g2bCCu+W5lP+lBBdZz1/ixKW13Bjr1TKfdO/Zs4j NxUiMDZX7qdep7foybMENvKfSI//OPB6+05lQu6AuQYw4vBBDGI3i1Ye10AffCx9xezp oqnSl3e4drJJBeq2D/WrtWzD7iVVfelU8MWJ9BGCBEArgcYL/Nm5qjJVzpipL0Uj80iL e/PlFgxt1H+jqr7hymJ7nFcE5g9ru03naya+LZbBfMehOTpwXlLuePekyJXTiARbhvA8 9bLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xAb+4CRX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u13-20020a170903124d00b001b86671b3f1si10412004plh.190.2023.09.13.04.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 04:27:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xAb+4CRX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5E96281A9B52; Tue, 12 Sep 2023 20:51:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236866AbjIMDvM (ORCPT + 36 others); Tue, 12 Sep 2023 23:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbjIMDvK (ORCPT ); Tue, 12 Sep 2023 23:51:10 -0400 Received: from out-220.mta0.migadu.com (out-220.mta0.migadu.com [IPv6:2001:41d0:1004:224b::dc]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394E8172B for ; Tue, 12 Sep 2023 20:51:06 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694577064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wk0aXTAElE79+EX7YkShEQJOBh1Ww7m9AhWaKXcP+HU=; b=xAb+4CRXl0hHZ6+fRJK4pT0roSElfuf4R2pSRDncD3ZGoXAM/BCgeVEQJfzSO4+mjVolxj HBS0nBYli2a5V2fjVt0n3kZnfC9beSXrsOpRbZratcNVg4jSHuAw1d+UDv6syvmKfA35Z6 sxHV1/I88dkcpLLzcZVbdmLPJLHNeGs= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v4 1/6] blk-mq-tag: support queue filter in bt_tags_iter() Date: Wed, 13 Sep 2023 03:50:28 +0000 Message-Id: <20230913035033.1549277-2-chengming.zhou@linux.dev> In-Reply-To: <20230913035033.1549277-1-chengming.zhou@linux.dev> References: <20230913035033.1549277-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:51:46 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776921547571989304 X-GMAIL-MSGID: 1776921547571989304 From: Chengming Zhou The only user of bt_for_each() is blk_mq_queue_tag_busy_iter(), which need to filter queue when iterate the tags. In preparation of removing bt_for_each(), support queue filter in bt_tags_iter(). Reviewed-by: Bart Van Assche Signed-off-by: Chengming Zhou --- block/blk-mq-tag.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index cc57e2dd9a0b..3cf3cf72cd54 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -329,6 +329,7 @@ struct bt_tags_iter_data { busy_tag_iter_fn *fn; void *data; unsigned int flags; + struct request_queue *q; }; #define BT_TAG_ITER_RESERVED (1 << 0) @@ -357,9 +358,13 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) if (!rq) return true; + if (iter_data->q && iter_data->q != rq->q) + goto out; + if (!(iter_data->flags & BT_TAG_ITER_STARTED) || blk_mq_request_started(rq)) ret = iter_data->fn(rq, iter_data->data); +out: if (!iter_static_rqs) blk_mq_put_rq_ref(rq); return ret; From patchwork Wed Sep 13 03:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 138663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp885888vqx; Tue, 12 Sep 2023 23:24:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEngZhE06OG69936OK8E5cnjj6kHEYbfZYHcAAnhb2rao65Nd20s2tTcWy3H3e2t9MqAxzy X-Received: by 2002:a17:903:1208:b0:1c3:6251:a78 with SMTP id l8-20020a170903120800b001c362510a78mr2224908plh.3.1694586264538; Tue, 12 Sep 2023 23:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694586264; cv=none; d=google.com; s=arc-20160816; b=C4T8LMpPE9xq5ZIQx4B0ysFgNneuYb8sk1DsaUWI1cO7FnYXuFTFgxrnNfBqp9e67e UNdv0c19Z9uSbwXBFsRv6Jr05en64GFz2GS3/bKaau/Gb001EoJBcpviGVaPk1Zhvh8W nliQUMtGKg1t70PCz+H4zhhOyBCePvW8qBPn9I0atoj3LJ+QrbGAkT2IeV7ZDDJEmjJh P9yTiIvruXzotGOpsp8rF/v3X1Awz8iS1NX77jJIMdLCOSncE5PLymwT2SHySAevQFym hZto95OYLEva9JQTduQAWg9O2F+cqkOcu/pFBU1pHdfV2KXFalu9CS/xIz+sq0p/oJHa PR/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HEQUCPUPTnw8DVS45Whbzs7PuWsvHPKXqwBfw1rbYI4=; fh=0kSCNnJ+Dz7/k19JqdLGTHBnZxdhAtg5C+lF7soNwhs=; b=JAm7JjX/DE+NZewQhKimEtF73ThStVzQkJefdEqc/c76uPL3rj5zoAz+79sqL/tnrb LFeBKZtXZfMKiEJjj6ZHcvR/3f8LmtxD8fDz/XekIvNccZjUi36JVL6GlVnwkyNcdvWe Yr0m3Radn3uSjhgi337mnWAhHYhnEaZ6oUzOM1b+L14TItd6ZtlyUXc3AlNj5frr9Cmk 0qMs0zNB3aFBdaz5XD8dJqtXw4+GhN17xh0KtzztLeAYPfHqlKyEe6m6R78/AgTKSD0x IcGLsWYOlw0YjHZdljjjlNwabrTISAB3rzCaBK8ov7AObqyxkWL3kHDAgN+h/axzXn9p cCoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ssUxvOoX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c13-20020a170902d48d00b001c3a6902ff1si6344963plg.288.2023.09.12.23.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 23:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ssUxvOoX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1CDBF8225CAD; Tue, 12 Sep 2023 20:51:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235972AbjIMDvY (ORCPT + 36 others); Tue, 12 Sep 2023 23:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236065AbjIMDvM (ORCPT ); Tue, 12 Sep 2023 23:51:12 -0400 Received: from out-211.mta0.migadu.com (out-211.mta0.migadu.com [IPv6:2001:41d0:1004:224b::d3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E23A5172C for ; Tue, 12 Sep 2023 20:51:07 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694577066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HEQUCPUPTnw8DVS45Whbzs7PuWsvHPKXqwBfw1rbYI4=; b=ssUxvOoXRUx2Pm6338qfoIwPn+XyiQU0rIfk8nVcF0TtKWrXpDxxFPUgY2e9y0Y7m3Oue0 DYgkAFvj9Shjeqs0cwM0NWJd/2n/wM7Xea1Az4VMr1IYnqz2jEkRLEfSdLeckiQhAgnTfr d0gjwXhTex1t74vgRyp8NR6DrmptqRs= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v4 2/6] blk-mq-tag: introduce __blk_mq_tagset_busy_iter() Date: Wed, 13 Sep 2023 03:50:29 +0000 Message-Id: <20230913035033.1549277-3-chengming.zhou@linux.dev> In-Reply-To: <20230913035033.1549277-1-chengming.zhou@linux.dev> References: <20230913035033.1549277-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:51:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776902486666118547 X-GMAIL-MSGID: 1776902486666118547 From: Chengming Zhou For support of specified queue filter when iterating over a tagset, we introduce __blk_mq_tagset_busy_iter() here and all current users just set queue as NULL which means have no queue filter. Reviewed-by: Bart Van Assche Signed-off-by: Chengming Zhou --- block/blk-mq-tag.c | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 3cf3cf72cd54..dc4edde3c80a 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -381,15 +381,18 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) * to continue iterating tags, false to stop. * @data: Will be passed as second argument to @fn. * @flags: BT_TAG_ITER_* + * @q: Only iterate over requests of this queue. */ static void bt_tags_for_each(struct blk_mq_tags *tags, struct sbitmap_queue *bt, - busy_tag_iter_fn *fn, void *data, unsigned int flags) + busy_tag_iter_fn *fn, void *data, unsigned int flags, + struct request_queue *q) { struct bt_tags_iter_data iter_data = { .tags = tags, .fn = fn, .data = data, .flags = flags, + .q = q, }; if (tags->rqs) @@ -397,14 +400,15 @@ static void bt_tags_for_each(struct blk_mq_tags *tags, struct sbitmap_queue *bt, } static void __blk_mq_all_tag_iter(struct blk_mq_tags *tags, - busy_tag_iter_fn *fn, void *priv, unsigned int flags) + busy_tag_iter_fn *fn, void *priv, unsigned int flags, + struct request_queue *q) { WARN_ON_ONCE(flags & BT_TAG_ITER_RESERVED); if (tags->nr_reserved_tags) bt_tags_for_each(tags, &tags->breserved_tags, fn, priv, - flags | BT_TAG_ITER_RESERVED); - bt_tags_for_each(tags, &tags->bitmap_tags, fn, priv, flags); + flags | BT_TAG_ITER_RESERVED, q); + bt_tags_for_each(tags, &tags->bitmap_tags, fn, priv, flags, q); } /** @@ -422,7 +426,23 @@ static void __blk_mq_all_tag_iter(struct blk_mq_tags *tags, void blk_mq_all_tag_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn, void *priv) { - __blk_mq_all_tag_iter(tags, fn, priv, BT_TAG_ITER_STATIC_RQS); + __blk_mq_all_tag_iter(tags, fn, priv, BT_TAG_ITER_STATIC_RQS, NULL); +} + +static void __blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset, + busy_tag_iter_fn *fn, void *priv, + struct request_queue *q) +{ + unsigned int flags = tagset->flags; + int i, nr_tags; + + nr_tags = blk_mq_is_shared_tags(flags) ? 1 : tagset->nr_hw_queues; + + for (i = 0; i < nr_tags; i++) { + if (tagset->tags && tagset->tags[i]) + __blk_mq_all_tag_iter(tagset->tags[i], fn, priv, + BT_TAG_ITER_STARTED, q); + } } /** @@ -441,16 +461,7 @@ void blk_mq_all_tag_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn, void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset, busy_tag_iter_fn *fn, void *priv) { - unsigned int flags = tagset->flags; - int i, nr_tags; - - nr_tags = blk_mq_is_shared_tags(flags) ? 1 : tagset->nr_hw_queues; - - for (i = 0; i < nr_tags; i++) { - if (tagset->tags && tagset->tags[i]) - __blk_mq_all_tag_iter(tagset->tags[i], fn, priv, - BT_TAG_ITER_STARTED); - } + __blk_mq_tagset_busy_iter(tagset, fn, priv, NULL); } EXPORT_SYMBOL(blk_mq_tagset_busy_iter); From patchwork Wed Sep 13 03:50:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 138653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp879492vqx; Tue, 12 Sep 2023 23:06:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwu0NjeMP9WfqB9ep3If9ILm31mfFGpZKia+jgXHlKfaNATIMGphc5lkr47Q9RxtVjB2aJ X-Received: by 2002:a05:6358:6f17:b0:134:c4dc:2c43 with SMTP id r23-20020a0563586f1700b00134c4dc2c43mr1704601rwn.28.1694585208377; Tue, 12 Sep 2023 23:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694585208; cv=none; d=google.com; s=arc-20160816; b=UwXn/aEGaLd4qZdWxIi207sIN14laOA9sqW76WtYZg3TEohrDYEd+ataORnv+0Dd84 MQU2+MInK+xk1SQcXui3f0VlQPOVtL7lMVYy1ISEDrDslSIt8VIn8j9uhkyEPGCgfNEZ 24QcURRtUG8YGAASoyGFa5NP/vON74qtQakzBdbIH/2cFMD9g4va8p5vMtncpMKf84y9 ltSurLbFpUImVO4HVTxzmlxFL3KQ7hw9rr4n2rZLTIZwEsXmv9WGN/zGU1iBiVqtNrYg J9oTX6uSwiuUsxxyN7LAkSa7JaDTg7VpCWPPL5NzaM0bnQ6ZlgIsHxd2K3P68VrBfMpI hcMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l0J2KdIXBZzKToHETr5IICIXYsUscX31c5YuO5la0Sc=; fh=0kSCNnJ+Dz7/k19JqdLGTHBnZxdhAtg5C+lF7soNwhs=; b=Ljt5Zdo9Gd7eN79S1C++1gkJ8ZXsPZlrDe8MXPmeeQGx5rc4PVOTGqDHyUdu62+raz nhP2LBXZl9j5/LTgpt+BjkBHuzbk184SeeIbprSs90K/zEs6RJaBrQff6MHmGGxcYaAV uGTLSC7747HAC9lTuVLqyxDjl3ANRobXrvSKt0P30+GJaMJ6I1a1ENA4+Lc00EzWNVq9 Le+ytkI41iJlZqqi/5WvJyn+b+KRCc56fUn/LHhHwQupE3ZwWtveE81meg4bOauzLXnG ZfEWiMY6pTH7taDYWrxqrRWJaSQmAX/BihlSKp01aNZdhal6pHuqG0DuP5Imi0BRthXo X53A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Jz1oZ3eZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id m1-20020a656a01000000b0051b90567f99si10157817pgu.690.2023.09.12.23.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 23:06:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Jz1oZ3eZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8A96981BE2CD; Tue, 12 Sep 2023 20:51:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234151AbjIMDvV (ORCPT + 36 others); Tue, 12 Sep 2023 23:51:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237562AbjIMDvN (ORCPT ); Tue, 12 Sep 2023 23:51:13 -0400 Received: from out-211.mta0.migadu.com (out-211.mta0.migadu.com [IPv6:2001:41d0:1004:224b::d3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AACD1730 for ; Tue, 12 Sep 2023 20:51:09 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694577068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0J2KdIXBZzKToHETr5IICIXYsUscX31c5YuO5la0Sc=; b=Jz1oZ3eZlVbLc58wbXXq9fi5nLOEoUZhKoqk69495Hat27LKyoCJYGpjZa8KX5i/QlsXYr Od8/g2H4XQmwaWIpXpxNO0J3mIvqssu3eQ3J+XMrjmk24Zx/hbyMrPz9xG87bKcCOOC+dX Bwcv16xIbIl6R1ChETHGn553mci3+8g= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v4 3/6] blk-mq-tag: remove bt_for_each() Date: Wed, 13 Sep 2023 03:50:30 +0000 Message-Id: <20230913035033.1549277-4-chengming.zhou@linux.dev> In-Reply-To: <20230913035033.1549277-1-chengming.zhou@linux.dev> References: <20230913035033.1549277-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:51:35 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776901379717941608 X-GMAIL-MSGID: 1776901379717941608 From: Chengming Zhou Change the only user of bt_for_each() to use the introduced function __blk_mq_tagset_busy_iter() to specify queue filter when iterating. Since blk_mq_queue_tag_busy_iter() is only used to iterate over started requests, __blk_mq_tagset_busy_iter() already have BT_TAG_ITER_STARTED filter to iterate over started requests only, there should be no problem. Only one potential disadvantage I can see is that we lost the blk_mq_hw_queue_mapped() filter, which maybe not happen for now. Unmapped hctx was used to dynamically map or unmap when CPU hotplug, but we don't do this anymore, we always map all possible CPUs now. So it seems unmapped hctx may only happen if something wrong with driver's tagset map settings. Reviewed-by: Bart Van Assche Signed-off-by: Chengming Zhou --- block/blk-mq-tag.c | 99 +--------------------------------------------- 1 file changed, 1 insertion(+), 98 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index dc4edde3c80a..3ddc0c7b7f7e 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -241,14 +241,6 @@ void blk_mq_put_tags(struct blk_mq_tags *tags, int *tag_array, int nr_tags) tag_array, nr_tags); } -struct bt_iter_data { - struct blk_mq_hw_ctx *hctx; - struct request_queue *q; - busy_tag_iter_fn *fn; - void *data; - bool reserved; -}; - static struct request *blk_mq_find_and_get_req(struct blk_mq_tags *tags, unsigned int bitnr) { @@ -263,67 +255,6 @@ static struct request *blk_mq_find_and_get_req(struct blk_mq_tags *tags, return rq; } -static bool bt_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) -{ - struct bt_iter_data *iter_data = data; - struct blk_mq_hw_ctx *hctx = iter_data->hctx; - struct request_queue *q = iter_data->q; - struct blk_mq_tag_set *set = q->tag_set; - struct blk_mq_tags *tags; - struct request *rq; - bool ret = true; - - if (blk_mq_is_shared_tags(set->flags)) - tags = set->shared_tags; - else - tags = hctx->tags; - - if (!iter_data->reserved) - bitnr += tags->nr_reserved_tags; - /* - * We can hit rq == NULL here, because the tagging functions - * test and set the bit before assigning ->rqs[]. - */ - rq = blk_mq_find_and_get_req(tags, bitnr); - if (!rq) - return true; - - if (rq->q == q && (!hctx || rq->mq_hctx == hctx)) - ret = iter_data->fn(rq, iter_data->data); - blk_mq_put_rq_ref(rq); - return ret; -} - -/** - * bt_for_each - iterate over the requests associated with a hardware queue - * @hctx: Hardware queue to examine. - * @q: Request queue to examine. - * @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 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. - * @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. - */ -static void bt_for_each(struct blk_mq_hw_ctx *hctx, struct request_queue *q, - struct sbitmap_queue *bt, busy_tag_iter_fn *fn, - void *data, bool reserved) -{ - struct bt_iter_data iter_data = { - .hctx = hctx, - .fn = fn, - .data = data, - .reserved = reserved, - .q = q, - }; - - sbitmap_for_each_set(&bt->sb, bt_iter, &iter_data); -} - struct bt_tags_iter_data { struct blk_mq_tags *tags; busy_tag_iter_fn *fn; @@ -520,35 +451,7 @@ void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_tag_iter_fn *fn, if (!percpu_ref_tryget(&q->q_usage_counter)) return; - if (blk_mq_is_shared_tags(q->tag_set->flags)) { - struct blk_mq_tags *tags = q->tag_set->shared_tags; - struct sbitmap_queue *bresv = &tags->breserved_tags; - struct sbitmap_queue *btags = &tags->bitmap_tags; - - if (tags->nr_reserved_tags) - bt_for_each(NULL, q, bresv, fn, priv, true); - bt_for_each(NULL, q, btags, fn, priv, false); - } else { - struct blk_mq_hw_ctx *hctx; - unsigned long i; - - queue_for_each_hw_ctx(q, hctx, i) { - struct blk_mq_tags *tags = hctx->tags; - struct sbitmap_queue *bresv = &tags->breserved_tags; - struct sbitmap_queue *btags = &tags->bitmap_tags; - - /* - * If no software queues are currently mapped to this - * hardware queue, there's nothing to check - */ - if (!blk_mq_hw_queue_mapped(hctx)) - continue; - - if (tags->nr_reserved_tags) - bt_for_each(hctx, q, bresv, fn, priv, true); - bt_for_each(hctx, q, btags, fn, priv, false); - } - } + __blk_mq_tagset_busy_iter(q->tag_set, fn, priv, q); blk_queue_exit(q); } From patchwork Wed Sep 13 03:50:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 138623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp839441vqx; Tue, 12 Sep 2023 21:04:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcVeNknw7T5w0sbmFHVYI8c4G3FpwSuc/9bZ7YAGC4XEiXGK/wlmb9zSkaIoKd2H6b7DWU X-Received: by 2002:a17:90b:4b52:b0:269:3dd5:b009 with SMTP id mi18-20020a17090b4b5200b002693dd5b009mr1083038pjb.44.1694577881599; Tue, 12 Sep 2023 21:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694577881; cv=none; d=google.com; s=arc-20160816; b=ZJfUNVeaOE4GJEv4XeWiLcXbUdWry8Z5kQzxwwhKBAuAiLxSmSevJ/0teYV/a/hPQZ hUcpN6VNTaTqTZMhJJxrqs0ZuU9a+qn1bikc7eqYI91khMpoxnE44VwfYa0TJjhwZ6Vj RrJpE6n0KyZRJsaZR4FKUbNyTte2J1i174IuGGA+Gat1cQ13aXKRaOkJRX9cZVd91zIb AHc0w2c5FL6FE25FpEa2aB5sRs9yHhdq6OvwLS/p7E2gd1xk9Bu+8ONaFFHQHMw/NJ8j nhocHoW4VvuTTtt7yTUVWnDkgXbl/ElzjYkiwQkiqhQNLi7edzgWFQfA9wPsSEtzOsCU 1HgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CwOToPUftF0QYoHtVkc85ZdKan8gl08CbzCEbRbTyKA=; fh=0kSCNnJ+Dz7/k19JqdLGTHBnZxdhAtg5C+lF7soNwhs=; b=JB91fUAuMJpJha6k+QT9M7ASqleDDXU+C+ECA0qj+IpRvOT7Jo1QG9YlrSVeB2Pm2d hWL8OYeUd6YFefMPnWKyWMQ1+1VjaEKCp/EXGQ3QfAyjGXoTAtx1XhLtdgnFsYadBNG5 cJJdhNvUYzPY9CFt66g6eutvX4q3S4bp3pU1K6QRl8OKZgYHMWZMrPcg4qop4wrtoS3w Kn5w+4iFmf+3Ne+7ud8+337/YcRHelctOf2Nwb1Kx2aCNYe8Y+KS/zaFPnKpxXB4bTnS lQnww+DaW0I88TtzYXngOh5Hsd27FLu4f4NL5bIFompiFXQyQCYmj/fLTfEgIeb8HvvE 8qmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=aKCAzuHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h6-20020a17090a604600b002680b23aff7si702505pjm.161.2023.09.12.21.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 21:04:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=aKCAzuHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CE5B7826EBAE; Tue, 12 Sep 2023 20:51:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238321AbjIMDv3 (ORCPT + 36 others); Tue, 12 Sep 2023 23:51:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238250AbjIMDvT (ORCPT ); Tue, 12 Sep 2023 23:51:19 -0400 Received: from out-224.mta0.migadu.com (out-224.mta0.migadu.com [91.218.175.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED0A173C for ; Tue, 12 Sep 2023 20:51:11 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694577069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CwOToPUftF0QYoHtVkc85ZdKan8gl08CbzCEbRbTyKA=; b=aKCAzuHc3FjbIB54vrQc5onYeA8q2UVdaWLmog2d/11qaoDItd1QfZ+kudbyz/gvqOsXMt ILAShXyZaHeE6/+qrx6SJtAqP187/lvCLrAlXVZzO0VISLUxn9TDX0IIS0m4OIaXwOC/4g RBOYyy+zxiz+Qth/sfIkfX5f0oxAVlw= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v4 4/6] blk-mq: delete superfluous check in iterate callback Date: Wed, 13 Sep 2023 03:50:31 +0000 Message-Id: <20230913035033.1549277-5-chengming.zhou@linux.dev> In-Reply-To: <20230913035033.1549277-1-chengming.zhou@linux.dev> References: <20230913035033.1549277-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:51:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776893696700283338 X-GMAIL-MSGID: 1776893696700283338 From: Chengming Zhou The previous patch in this series changed the behavior of blk_mq_queue_tag_busy_iter() from iterating over all allocated tags into iterating over started requests only. Leave out the code from blk_mq_rq_inflight() that became superfluous because of this change. Reviewed-by: Bart Van Assche Signed-off-by: Chengming Zhou --- block/blk-mq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 1fafd54dce3c..1473b49350c4 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1513,19 +1513,15 @@ EXPORT_SYMBOL(blk_mq_delay_kick_requeue_list); static bool blk_mq_rq_inflight(struct request *rq, void *priv) { + bool *busy = priv; + /* * If we find a request that isn't idle we know the queue is busy * as it's checked in the iter. * Return false to stop the iteration. */ - if (blk_mq_request_started(rq)) { - bool *busy = priv; - - *busy = true; - return false; - } - - return true; + *busy = true; + return false; } bool blk_mq_queue_inflight(struct request_queue *q) From patchwork Wed Sep 13 03:50:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 138739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp982090vqx; Wed, 13 Sep 2023 03:22:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNySG12WJ9iC8NsIOYiAXA6ra0WFMkq5uwGNSLvgchSkq0wNabsFtGKvs7evGkcs6W7j+t X-Received: by 2002:a17:90b:3149:b0:268:3b8b:140d with SMTP id ip9-20020a17090b314900b002683b8b140dmr1452792pjb.35.1694600575316; Wed, 13 Sep 2023 03:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694600575; cv=none; d=google.com; s=arc-20160816; b=ETB/Qp23I3rCE3mpHRA9IdrXl5BhYXoPmtAfvROQs1LEw/TLAK8TRIlGmXzoGWHYy/ 9gQAUa7fBS3uftdhneE8X5JyjM/Q9++GWWHNzaJxw0K56yibf1upgedwzFlIm2bYzDys diYmvA2IjPEb58gXFThBaDwicMa0JG0e2JV7yB8PCIIyX8pde2yDkNFxZsbVxjGwRmVp ptFyNbq3pXsszDRX6TWAMR8QUadp5uwPdpDpWy9hvuVEY0VvjHiPGvdbYdkYs6l2vKvr rixPyK4uWq+HEgoYsa+h8BkUwynLmncK/m5sBQVubiKk8cd3nsrNVGjI2LZECf0K5h/u 87vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tr2y1RXEAqFREuCr8X/bFxj1HZWX82tlPsNorh3+Y6g=; fh=0kSCNnJ+Dz7/k19JqdLGTHBnZxdhAtg5C+lF7soNwhs=; b=wLe1I5hQ4A+OSSjNrdocHBoCACPzy+d7dKGqcfaRf9xgaBrMs3rEJJFYpiyms8iitX VBQF+JrSpcqyv4kRafNtIUvlPaXpt0Kpc4qUw7dgRqykg0uUu46pnhZ5Q4gIwAt4wNX1 PmjQDNGCruTbzHEPvmyNqsa1l1YXkqG2lzOsj4RP8hJbQHqpZLN5QMKooiWhbemP4MKN ADq1P1ivcwxMhVmTg8MjLinwv6sFaMlrO/cI4TSaGwtfUUlu9oAdZXzy8pKFIjiNyDl6 LEygscCXWCIcfjRx1RQqSEqrrmenxlZlr+POPp0NznR5hdp3BsndhCVGNCJQD645AjFk 7dww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Xe3QWvFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id np9-20020a17090b4c4900b00273fde2471esi1386000pjb.88.2023.09.13.03.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 03:22:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Xe3QWvFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EC74C822D569; Tue, 12 Sep 2023 20:51:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238271AbjIMDv0 (ORCPT + 36 others); Tue, 12 Sep 2023 23:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238262AbjIMDvV (ORCPT ); Tue, 12 Sep 2023 23:51:21 -0400 Received: from out-229.mta0.migadu.com (out-229.mta0.migadu.com [91.218.175.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62DED1989 for ; Tue, 12 Sep 2023 20:51:13 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694577071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tr2y1RXEAqFREuCr8X/bFxj1HZWX82tlPsNorh3+Y6g=; b=Xe3QWvFEiv03j7kyGYShuLqk4W1WQG3vHr92YijOPzUaq7YxU1tUwyw9DmPQezs3eof0bh E34dtvSBWS32CG0ZaJksOasz19sNwffkVYrI93uAIBd84MAf1IngkYa6V+k2ozcV2Tv3sS iTQz9OSB6VFt6yjtLXLfcgKbRgH0+9A= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v4 5/6] blk-mq-tag: fix functions documentation Date: Wed, 13 Sep 2023 03:50:32 +0000 Message-Id: <20230913035033.1549277-6-chengming.zhou@linux.dev> In-Reply-To: <20230913035033.1549277-1-chengming.zhou@linux.dev> References: <20230913035033.1549277-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:51:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776917492646297063 X-GMAIL-MSGID: 1776917492646297063 From: Chengming Zhou There are some stale functions documentation in blk-mq-tag, since the prototype of busy_tag_iter_fn() has changed. Fix it as we're here. Fixes: 2dd6532e9591 ("blk-mq: Drop 'reserved' arg of busy_tag_iter_fn") Reviewed-by: Bart Van Assche Signed-off-by: Chengming Zhou --- block/blk-mq-tag.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 3ddc0c7b7f7e..0d42f3c4d76e 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -307,9 +307,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_* * @q: Only iterate over requests of this queue. @@ -346,10 +346,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. @@ -380,10 +379,9 @@ static void __blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset, * 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 @@ -430,11 +428,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. - * @priv: Will be passed as third argument to @fn. + * on @q. @fn will be called as follows: @fn(rq, @priv) where rq + * is a pointer to a request. + * @priv: Will be passed as second argument to @fn. * * Note: if @q->tag_set is shared with other request queues then @fn will be * called for all requests on all queues that share that tag set and not only From patchwork Wed Sep 13 03:50:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 138707 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp945707vqx; Wed, 13 Sep 2023 02:00:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUWegesnEu9IgISg+mssPN9Mu44d1iYeW6s6sfJEWphxG0MRArtHepOTZV/Cmca67KyZhZ X-Received: by 2002:a05:6a20:4327:b0:13f:1622:29de with SMTP id h39-20020a056a20432700b0013f162229demr1906804pzk.7.1694595618949; Wed, 13 Sep 2023 02:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694595618; cv=none; d=google.com; s=arc-20160816; b=0pLnOljaezW0b+SCaeZZ2MedD3vd1sbuY1HAzy+0eIU06zD4QVzzFtyVm3TGpIiB97 buCY+9eo+sqalZMZa/PWPsJ+/MraxQY6IYznAa3L9n0WfaYW1a0QHnWf6E//fNsK2xL0 rmn28WfVLtSVA4I85gmIxP5wACJFoR6Axofj3uSkusNFvzvUjMoO73s3D1M4Y/uVluff mGtutrQ12WXQewfwT19UHH0wfvXDoA8CS0peXrws1SMSlv7HNe+yJT6CB2f7NUCu5oO7 cDBTRughxZkKpDQxRhIqJxUeywEjgz90XhWYwNsuMtw/MyYaMNfQtZHfh+9NiGZval15 W15Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hJ+K59AtY5YkcpgFDD7Z6/goeR9+RX3ce7piF7Aa0ls=; fh=0kSCNnJ+Dz7/k19JqdLGTHBnZxdhAtg5C+lF7soNwhs=; b=aHYkDOSszBb6OCAnC2ceUxqIbrI1Q96zvn9Q/7sPt0I7k4KdyU5yrP+kZOX40HgVpS eewii0xOGG5Y4r0QMHudCC3Y89huEN5zKCioyyw7veD0ShRODC5dicJtzwz1lQ/Nlomb FGOypnCe/dJX2D1+RXtrwV1nQ9tRWRlmVDOT5yvmletl5FcxRdmwIWLXOfjNwiwn96Zo sipHGnTDMkZYhw+NLtU8j0mCJEHeCipWxeHK20flNETVzZs3GCiKhn4ojmzKfoFas0gl 9O/71/fPpJ0qT4gOwpYrjEXsqNiUyNAgzLcmvkwaQ3ilqegY2KaQBw/XZmYV+Iyebi9p y6hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ec8W6HwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id o11-20020a170903210b00b001bbd0358ef7si9480803ple.518.2023.09.13.02.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 02:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ec8W6HwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4AE6A80EE75B; Tue, 12 Sep 2023 20:51:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238292AbjIMDvh (ORCPT + 36 others); Tue, 12 Sep 2023 23:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238261AbjIMDvW (ORCPT ); Tue, 12 Sep 2023 23:51:22 -0400 Received: from out-211.mta0.migadu.com (out-211.mta0.migadu.com [91.218.175.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4174C172B for ; Tue, 12 Sep 2023 20:51:15 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694577073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hJ+K59AtY5YkcpgFDD7Z6/goeR9+RX3ce7piF7Aa0ls=; b=ec8W6HwLVuud2KIvlVS4SYZAbsWXI7UUGxXY9Ut/TyTKG3LM275Rxk+Wj9LxEWy+VkzHdk daotb2zixe1uiRnmvd7iqjXHY91/2BPW0OVtoMC2ik2Tci1U6oqAHBCHggCR/Fm3022Wz2 iaFoMP5HWb+YA8QwELrFDILYH2ONp5s= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v4 6/6] blk-mq-tag: fix blk_mq_queue_tag_busy_iter() documentation Date: Wed, 13 Sep 2023 03:50:33 +0000 Message-Id: <20230913035033.1549277-7-chengming.zhou@linux.dev> In-Reply-To: <20230913035033.1549277-1-chengming.zhou@linux.dev> References: <20230913035033.1549277-1-chengming.zhou@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:51:59 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776912295714316577 X-GMAIL-MSGID: 1776912295714316577 From: Chengming Zhou The blk_mq_queue_tag_busy_iter() is only used to iterate over requests of the specified queue, fix the documentation. Fixes: c7b1bf5cca76 ("blk-mq: Document the functions that iterate over requests") Reviewed-by: Bart Van Assche Signed-off-by: Chengming Zhou --- block/blk-mq-tag.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 0d42f3c4d76e..69b156750559 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -433,8 +433,7 @@ EXPORT_SYMBOL(blk_mq_tagset_wait_completed_request); * @priv: Will be passed as second argument to @fn. * * Note: if @q->tag_set is shared with other request queues then @fn will be - * called for all requests on all queues that share that tag set and not only - * for requests associated with @q. + * called only for requests associated with @q. */ void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_tag_iter_fn *fn, void *priv)