public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
	axboe@kernel.dk, bvanassche@acm.org, ming.lei@redhat.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com,
	johnny.chenyi@huawei.com
Subject: Re: [PATCH 3/7] blk-mq: add a new queue sysfs attribute async_depth
Date: Thu, 2 Oct 2025 20:40:46 +0530	[thread overview]
Message-ID: <91799590-15cd-437d-900f-8bc372f7298b@linux.ibm.com> (raw)
In-Reply-To: <20250930071111.1218494-4-yukuai1@huaweicloud.com>



On 9/30/25 12:41 PM, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> Add a new field async_depth to request_queue and related APIs, this is
> currently not used, following patches will convert elevators to use
> this instead of internal async_depth.
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  block/blk-core.c       |  1 +
>  block/blk-mq.c         |  4 ++++
>  block/blk-sysfs.c      | 47 ++++++++++++++++++++++++++++++++++++++++++
>  block/elevator.c       |  1 +
>  include/linux/blkdev.h |  1 +
>  5 files changed, 54 insertions(+)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index dd39ff651095..76df70cfc103 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -463,6 +463,7 @@ struct request_queue *blk_alloc_queue(struct queue_limits *lim, int node_id)
>  	fs_reclaim_release(GFP_KERNEL);
>  
>  	q->nr_requests = BLKDEV_DEFAULT_RQ;
> +	q->async_depth = BLKDEV_DEFAULT_RQ;
>  
>  	return q;
>  
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 09f579414161..260e54fa48f0 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -529,6 +529,8 @@ static struct request *__blk_mq_alloc_requests(struct blk_mq_alloc_data *data)
>  			data->rq_flags |= RQF_USE_SCHED;
>  			if (ops->limit_depth)
>  				ops->limit_depth(data->cmd_flags, data);
> +			else if (!blk_mq_sched_sync_request(data->cmd_flags))
> +				data->shallow_depth = q->async_depth;
>  		}

In the subsequent patches, I saw that ->limit_depth is still used for the
BFQ scheduler. Given that, it seems more consistent to also retain ->limit_depth
for the mq-deadline and Kyber schedulers, and set data->shallow_depth within their
respective ->limit_depth methods. If we take this approach, the additional 
blk_mq_sched_sync_request() check above becomes unnecessary.

So IMO:
- Keep ->limit_depth for all schedulers (bfq, mq-deadline, kyber).
- Remove the extra blk_mq_sched_sync_request() check from the core code.

Thanks,
--Nilay

  reply	other threads:[~2025-10-02 15:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30  7:11 [PATCH 0/7] blk-mq: introduce new queue attribute async_depth Yu Kuai
2025-09-30  7:11 ` [PATCH 1/7] block: convert nr_requests to unsigned int Yu Kuai
2025-10-02 15:13   ` Nilay Shroff
2025-09-30  7:11 ` [PATCH 2/7] blk-mq-sched: unify elevators checking for async requests Yu Kuai
2025-09-30  7:11 ` [PATCH 3/7] blk-mq: add a new queue sysfs attribute async_depth Yu Kuai
2025-10-02 15:10   ` Nilay Shroff [this message]
2025-10-06  1:57     ` Yu Kuai
2025-10-09  0:48       ` Yu Kuai
2025-10-09  6:42         ` Yu Kuai
2025-09-30  7:11 ` [PATCH 4/7] kyber: covert to use request_queue->async_depth Yu Kuai
2025-09-30  7:11 ` [PATCH 5/7] mq-deadline: " Yu Kuai
2025-10-02 18:56   ` Jeff Moyer
2025-09-30  7:11 ` [PATCH 6/7] block, bfq: convert " Yu Kuai
2025-09-30  7:11 ` [PATCH 7/7] blk-mq: add documentation for new queue attribute async_dpeth Yu Kuai
2025-10-02 15:12   ` Nilay Shroff
2025-10-06  2:00     ` Yu Kuai

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=91799590-15cd-437d-900f-8bc372f7298b@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=johnny.chenyi@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox