mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Yu Kuai <yukuai@kernel.org>, axboe@kernel.dk, bvanassche@acm.org
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 v3 3/7] blk-mq: add a new queue sysfs attribute async_depth
Date: Fri, 10 Oct 2025 10:17:47 +0530	[thread overview]
Message-ID: <b6518c17-e65f-4410-930c-04d3be364f9e@linux.ibm.com> (raw)
In-Reply-To: <20251010022812.2985286-4-yukuai@kernel.org>



On 10/10/25 7:58 AM, Yu Kuai wrote:
> +static ssize_t
> +queue_async_depth_store(struct gendisk *disk, const char *page, size_t count)
> +{
> +	struct request_queue *q = disk->queue;
> +	unsigned int memflags;
> +	unsigned long nr;
> +	int ret;
> +
> +	if (!queue_is_mq(q))
> +		return -EINVAL;
> +
> +	ret = queue_var_store(&nr, page, count);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (nr == 0)
> +		return -EINVAL;
> +
> +	memflags = blk_mq_freeze_queue(q);
> +	scoped_guard(mutex, &q->elevator_lock) {
> +		if (q->elevator) {
> +			q->async_depth = min(q->nr_requests, nr);
> +			if (q->elevator->type->ops.depth_updated)
> +				q->elevator->type->ops.depth_updated(q);
> +		} else {
> +			ret = -EINVAL;
> +		}
> +	}
> +	blk_mq_unfreeze_queue(q, memflags);
> +
> +	return ret;
> +}
> +
With this change, we've got the first user of scoped_guard() in the 
block subsystem!

Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>


  reply	other threads:[~2025-10-10  4:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10  2:28 [PATCH v3 0/7] blk-mq: introduce new queue " Yu Kuai
2025-10-10  2:28 ` [PATCH v3 1/7] block: convert nr_requests to unsigned int Yu Kuai
2025-10-10  2:28 ` [PATCH v3 2/7] blk-mq-sched: unify elevators checking for async requests Yu Kuai
2025-10-10  2:28 ` [PATCH v3 3/7] blk-mq: add a new queue sysfs attribute async_depth Yu Kuai
2025-10-10  4:47   ` Nilay Shroff [this message]
2025-10-10  2:28 ` [PATCH v3 4/7] kyber: covert to use request_queue->async_depth Yu Kuai
2025-10-10  2:28 ` [PATCH v3 5/7] mq-deadline: " Yu Kuai
2025-10-10  2:28 ` [PATCH v3 6/7] block, bfq: convert " Yu Kuai
2025-10-10  2:28 ` [PATCH v3 7/7] blk-mq: add documentation for new queue attribute async_dpeth 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=b6518c17-e65f-4410-930c-04d3be364f9e@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=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    --cc=yukuai@kernel.org \
    /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

all inboxes | Powered by JetHome®