mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Qiliang Yuan <qiliang.yuan@linux.dev>,
	Jens Axboe <axboe@kernel.dk>, Damien Le Moal <dlemoal@kernel.org>,
	Ming Lei <tom.leiming@gmail.com>, Hannes Reinecke <hare@suse.de>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v3 2/2] block: return early when the elevator doesn't change
Date: Tue, 17 Nov 2026 20:24:10 +0530	[thread overview]
Message-ID: <11341b42-f641-49da-b823-d7c083d83a9a@linux.ibm.com> (raw)
In-Reply-To: <20261116-bug-block-elevator-unchanged-v3-2-cb4dda2dadf4@linux.dev>

On 11/17/26 8:26 AM, Qiliang Yuan wrote:
> Writing the scheduler a queue already uses to queue/scheduler used to
> be a no-op. elevator_change() now only checks for an unchanged elevator
> after freezing the queue, and doesn't treat "none" on a queue without
> an elevator as unchanged at all, so that case also quiesces the queue
> in elevator_switch() and resets nr_requests.
> 
> Every such write therefore drains in-flight I/O and waits for an RCU
> grace period. udev rules and tuning tools that set the scheduler
> unconditionally stall I/O on live disks each time they run.
> 
> Check under elevator_lock whether anything would change before
> allocating scheduler resources and freezing the queue. The check can
> race with another elevator change, which at worst leads to a redundant
> switch, so keep the one done under the freeze as well.
> 
> Writing the current scheduler to queue/scheduler of a null_blk disk 20
> times takes (median):
> 
>    operation                 before (ms)  after (ms)  change
>    none -> none                     9.11        0.08    -99%
>    mq-deadline -> mq-deadline       9.05        0.08    -99%
> 
> 4k random reads at queue depth 1 for 10 seconds, while "none" is
> written to queue/scheduler every 50 ms:
> 
>    metric             before  after  change
>    IOPS               340562 390392    +15%
>    max latency (us)    16302   1224    -92%
> 
> Fixes: af2814149883e ("block: freeze the queue in queue_attr_store")
> Signed-off-by: Qiliang Yuan<qiliang.yuan@linux.dev>
> Reviewed-by: Christoph Hellwig<hch@lst.de>

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

  reply	other threads:[~2026-11-17 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  2:56 [PATCH v3 0/2] block: make changing to the current I/O scheduler cheap again Qiliang Yuan
2026-11-17  2:56 ` [PATCH v3 1/2] block: don't request a module for the none elevator Qiliang Yuan
2026-11-17 15:19   ` Hannes Reinecke
2026-11-17  2:56 ` [PATCH v3 2/2] block: return early when the elevator doesn't change Qiliang Yuan
2026-11-17 14:54   ` Nilay Shroff [this message]
2026-11-17 15:20   ` Hannes Reinecke

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=11341b42-f641-49da-b823-d7c083d83a9a@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiliang.yuan@linux.dev \
    --cc=tom.leiming@gmail.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

all inboxes | Powered by JetHome®