From: Bart Van Assche <bvanassche@acm.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@infradead.org>,
John Garry <john.g.garry@oracle.com>
Subject: Re: [PATCH 1/3] block: Export blk_mq_all_tag_iter()
Date: Thu, 11 Sep 2025 09:49:57 -0700 [thread overview]
Message-ID: <b890b767-fe4d-4096-81b9-ab94598a33d6@acm.org> (raw)
In-Reply-To: <CAFj5m9+8qyEjmRXJHHhZbD1cAKQReTxqahGr69PMKuy=9JMHLg@mail.gmail.com>
On 9/11/25 1:32 AM, Ming Lei wrote:
> On Thu, Sep 11, 2025 at 5:33 AM Bart Van Assche <bvanassche@acm.org> wrote:
>>
>> Prepare for using blk_mq_all_tag_iter() in the SCSI core.
>>
>> Cc: Jens Axboe <axboe@kernel.dk>
>> Cc: Christoph Hellwig <hch@infradead.org>
>> Cc: Ming Lei <ming.lei@redhat.com>
>> Cc: John Garry <john.g.garry@oracle.com>
>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>> ---
>> block/blk-mq-tag.c | 1 +
>> block/blk-mq.h | 2 --
>> include/linux/blk-mq.h | 2 ++
>> 3 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
>> index d880c50629d6..1d56ee8722c5 100644
>> --- a/block/blk-mq-tag.c
>> +++ b/block/blk-mq-tag.c
>> @@ -419,6 +419,7 @@ void blk_mq_all_tag_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
>> {
>> __blk_mq_all_tag_iter(tags, fn, priv, BT_TAG_ITER_STATIC_RQS);
>> }
>> +EXPORT_SYMBOL(blk_mq_all_tag_iter);
>
> IMO, it isn't correct to export an API for iterating over static
> requests for drivers.
Hi Ming,
A possible alternative is to add a new function that is similar to
blk_mq_tagset_busy_iter() except that it passes 0 as fourth argument to
__blk_mq_all_tag_iter() instead of BT_TAG_ITER_STARTED. Something like
this:
void blk_mq_tagset_iter(struct blk_mq_tag_set *tagset,
blk_mq_tag_iter_fn *fn, void *priv)
{
unsigned int flags = tagset->flags;
int i, nr_tags, srcu_idx;
srcu_idx = srcu_read_lock(&tagset->tags_srcu);
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, 0);
}
srcu_read_unlock(&tagset->tags_srcu, srcu_idx);
}
EXPORT_SYMBOL(blk_mq_tagset_busy_iter);
Thanks,
Bart.
next prev parent reply other threads:[~2025-09-11 16:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 21:32 [PATCH 0/3] Improve host-wide tag IOPS Bart Van Assche
2025-09-10 21:32 ` [PATCH 1/3] block: Export blk_mq_all_tag_iter() Bart Van Assche
2025-09-11 8:32 ` Ming Lei
2025-09-11 16:49 ` Bart Van Assche [this message]
2025-09-10 21:32 ` [PATCH 2/3] ufs: core: Use scsi_device_busy() Bart Van Assche
2025-09-11 9:18 ` Peter Wang (王信友)
2025-09-10 21:32 ` [PATCH 3/3] scsi: core: Improve IOPS in case of host-wide tags Bart Van Assche
2025-09-11 6:40 ` Hannes Reinecke
2025-09-11 15:45 ` Bart Van Assche
2025-09-11 8:15 ` John Garry
2025-09-11 15:59 ` Bart Van Assche
2025-09-11 17:37 ` Bart Van Assche
2025-09-12 14:37 ` John Garry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b890b767-fe4d-4096-81b9-ab94598a33d6@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=john.g.garry@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox