From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>,
Ming Lei <ming.lei@redhat.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: linux-block@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
Yu Kuai <yukuai3@huawei.com>,
kernel@collabora.com, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH V2 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators - Rockchip UFS regression
Date: Mon, 6 Oct 2025 17:03:19 -0600 [thread overview]
Message-ID: <07dbe66c-86d4-4a2d-ab7d-e0a351b3ae9f@kernel.dk> (raw)
In-Reply-To: <4f16e17d-796b-4896-9d4c-6d227514f1ca@acm.org>
On 10/6/25 12:02 PM, Bart Van Assche wrote:
> On 10/4/25 7:42 AM, Ming Lei wrote:
>> One possible fix is to check hba->scsi_host_added before calling
>> scsi_host_busy():
>>
>> dev_err(hba->dev, "%d outstanding reqs, tasks=0x%lx\n",
>> hba->scsi_host_added ? scsi_host_busy(hba->host) : 0,
>> hba->outstanding_tasks);
>
> My preference is to add a check inside scsi_host_busy(), e.g. as follows
> (entirely untested):
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index cc5d05dc395c..17173239301e 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -611,8 +611,9 @@ int scsi_host_busy(struct Scsi_Host *shost)
> {
> int cnt = 0;
>
> - blk_mq_tagset_busy_iter(&shost->tag_set,
> - scsi_host_check_in_flight, &cnt);
> + if (shost->tag_set.ops)
> + blk_mq_tagset_busy_iter(&shost->tag_set,
> + scsi_host_check_in_flight, &cnt);
> return cnt;
> }
> EXPORT_SYMBOL(scsi_host_busy);
Agree, that's a nicer way to solve it, putting that stuff outside
of actual drivers.
--
Jens Axboe
WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>,
Ming Lei <ming.lei@redhat.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: linux-block@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
Yu Kuai <yukuai3@huawei.com>,
kernel@collabora.com, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH V2 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators - Rockchip UFS regression
Date: Mon, 6 Oct 2025 17:03:19 -0600 [thread overview]
Message-ID: <07dbe66c-86d4-4a2d-ab7d-e0a351b3ae9f@kernel.dk> (raw)
In-Reply-To: <4f16e17d-796b-4896-9d4c-6d227514f1ca@acm.org>
On 10/6/25 12:02 PM, Bart Van Assche wrote:
> On 10/4/25 7:42 AM, Ming Lei wrote:
>> One possible fix is to check hba->scsi_host_added before calling
>> scsi_host_busy():
>>
>> dev_err(hba->dev, "%d outstanding reqs, tasks=0x%lx\n",
>> hba->scsi_host_added ? scsi_host_busy(hba->host) : 0,
>> hba->outstanding_tasks);
>
> My preference is to add a check inside scsi_host_busy(), e.g. as follows
> (entirely untested):
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index cc5d05dc395c..17173239301e 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -611,8 +611,9 @@ int scsi_host_busy(struct Scsi_Host *shost)
> {
> int cnt = 0;
>
> - blk_mq_tagset_busy_iter(&shost->tag_set,
> - scsi_host_check_in_flight, &cnt);
> + if (shost->tag_set.ops)
> + blk_mq_tagset_busy_iter(&shost->tag_set,
> + scsi_host_check_in_flight, &cnt);
> return cnt;
> }
> EXPORT_SYMBOL(scsi_host_busy);
Agree, that's a nicer way to solve it, putting that stuff outside
of actual drivers.
--
Jens Axboe
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2025-10-06 23:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 2:18 [PATCH V2 0/5] blk-mq: Replace tags->lock with SRCU for tag iterators Ming Lei
2025-08-30 2:18 ` [PATCH V2 1/5] blk-mq: Move flush queue allocation into blk_mq_init_hctx() Ming Lei
2025-08-30 2:18 ` [PATCH V2 2/5] blk-mq: Pass tag_set to blk_mq_free_rq_map/tags Ming Lei
2025-08-30 2:18 ` [PATCH V2 3/5] blk-mq: Defer freeing of tags page_list to SRCU callback Ming Lei
2025-08-30 2:18 ` [PATCH V2 4/5] blk-mq: Defer freeing flush queue " Ming Lei
2025-08-30 2:18 ` [PATCH V2 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators Ming Lei
2025-10-03 17:17 ` [PATCH V2 5/5] blk-mq: Replace tags->lock with SRCU for tag iterators - Rockchip UFS regression Sebastian Reichel
2025-10-03 17:17 ` Sebastian Reichel
2025-10-04 14:42 ` Ming Lei
2025-10-04 14:42 ` Ming Lei
2025-10-06 18:02 ` Bart Van Assche
2025-10-06 18:02 ` Bart Van Assche
2025-10-06 23:03 ` Jens Axboe [this message]
2025-10-06 23:03 ` Jens Axboe
2025-08-31 0:35 ` [PATCH V2 0/5] blk-mq: Replace tags->lock with SRCU for tag iterators Martin K. Petersen
2025-09-08 1:28 ` Ming Lei
2025-09-08 14:07 ` Jens Axboe
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=07dbe66c-86d4-4a2d-ab7d-e0a351b3ae9f@kernel.dk \
--to=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=kernel@collabora.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=ming.lei@redhat.com \
--cc=sebastian.reichel@collabora.com \
--cc=yukuai3@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.