Skip to content

block: skip quiescing the queue for the default elevator - #1444

Open
ghost wants to merge 2 commits into
linus-master_basefrom
series/1186034=>linus-master
Open

ghost wants to merge 2 commits into
linus-master_basefrom
series/1186034=>linus-master

Conversation

@ghost

@ghost ghost commented Oct 15, 2026

Copy link
Copy Markdown

Pull request for series with
subject: block: skip quiescing the queue for the default elevator
version: 2
url: https://patchwork.kernel.org/series/1186034/

@ghost

ghost commented Oct 15, 2026

Copy link
Copy Markdown
Author

Upstream branch: 0fcb05b
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the linus-master_base branch from e6ca2c1 to 3d027d5 Compare October 17, 2026 03:31
@ghost

ghost commented Oct 17, 2026

Copy link
Copy Markdown
Author

Upstream branch: 58161ea
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 61164d3 to 554517d Compare October 17, 2026 03:49
@ghost
ghost force-pushed the linus-master_base branch from 3d027d5 to 90ea7e4 Compare October 19, 2026 00:00
@ghost

ghost commented Oct 19, 2026

Copy link
Copy Markdown
Author

Upstream branch: c03c1a1
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 554517d to adae0a7 Compare October 19, 2026 00:32
@ghost ghost added the V2-ci-pass label Oct 19, 2026
@ghost
ghost force-pushed the linus-master_base branch from 90ea7e4 to 435b194 Compare October 22, 2026 07:21
@ghost

ghost commented Oct 22, 2026

Copy link
Copy Markdown
Author

Upstream branch: 7be4bc5
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from adae0a7 to 11d8ab3 Compare October 22, 2026 07:51
@ghost
ghost force-pushed the linus-master_base branch from 435b194 to fd67522 Compare October 24, 2026 03:36
@ghost

ghost commented Oct 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: 17bb0e2
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 11d8ab3 to 0ea6841 Compare October 24, 2026 03:59
@ghost ghost added V2-ci-fail and removed V2-ci-pass labels Oct 24, 2026
@ghost
ghost force-pushed the linus-master_base branch from fd67522 to 3b53a63 Compare October 26, 2026 01:52
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 21a7f44
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 0ea6841 to 60b3419 Compare October 26, 2026 02:23
@ghost
ghost force-pushed the linus-master_base branch from 3b53a63 to 5d84576 Compare October 26, 2026 07:01
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6b4b543
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 60b3419 to 478e683 Compare October 26, 2026 07:27
@ghost
ghost force-pushed the linus-master_base branch from 5d84576 to 6582ed2 Compare October 26, 2026 18:11
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: fb2c3f4
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 478e683 to 0812b6c Compare October 26, 2026 18:54
@ghost
ghost force-pushed the linus-master_base branch from 6582ed2 to b3a1abc Compare October 26, 2026 23:55
@ghost

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Author

Upstream branch: d135ab4
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 0812b6c to 86e39f4 Compare October 27, 2026 00:17
@ghost
ghost force-pushed the linus-master_base branch from b3a1abc to 712496f Compare October 28, 2026 23:34
@ghost

ghost commented Oct 28, 2026

Copy link
Copy Markdown
Author

Upstream branch: c339f40
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 86e39f4 to b2bb964 Compare October 28, 2026 23:58
@ghost
ghost force-pushed the linus-master_base branch from 712496f to a186880 Compare October 30, 2026 13:52
@ghost

ghost commented Oct 30, 2026

Copy link
Copy Markdown
Author

Upstream branch: d89e1d1
series: https://patchwork.kernel.org/series/1186034/
version: 2

1 similar comment
@ghost

ghost commented Oct 30, 2026

Copy link
Copy Markdown
Author

Upstream branch: d89e1d1
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from b2bb964 to 6a11604 Compare October 30, 2026 14:49
@ghost
ghost force-pushed the linus-master_base branch from a186880 to 46206a3 Compare November 2, 2026 17:14
@ghost

ghost commented Nov 2, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6628e7d
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 6a11604 to fd32329 Compare November 2, 2026 17:58
@ghost
ghost force-pushed the linus-master_base branch from 46206a3 to 220bd96 Compare November 3, 2026 23:41
@ghost

ghost commented Nov 4, 2026

Copy link
Copy Markdown
Author

Upstream branch: 05441d6
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from fd32329 to be1c093 Compare November 4, 2026 00:11
@ghost
ghost force-pushed the linus-master_base branch from 220bd96 to 6c4625e Compare November 6, 2026 08:02
@ghost

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Author

Upstream branch: f66469d
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from be1c093 to 36afd0b Compare November 6, 2026 08:51
@ghost
ghost force-pushed the linus-master_base branch from 6c4625e to c7f678d Compare November 7, 2026 03:08
@ghost

ghost commented Nov 7, 2026

Copy link
Copy Markdown
Author

Upstream branch: d487237
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 36afd0b to 806bdcd Compare November 7, 2026 03:47
@ghost ghost added V2-ci-pass and removed V2-ci-fail labels Nov 8, 2026
@ghost
ghost force-pushed the linus-master_base branch from c7f678d to 6aa6cd1 Compare November 10, 2026 07:53
Qiliang Yuan added 2 commits November 10, 2026 17:20
elevator_set_default() runs from blk_register_queue() while the disk is
still being added: the block device is not visible yet and uevents are
suppressed, so no file system I/O can be issued. elevator_change()
freezes the queue and cancels the dispatch work before switching, which
is enough to drain dispatch activity from passthrough requests, as the
comment in elevator_change() already states.

elevator_switch() still quiesces the queue unconditionally, though, so
every disk added with a default elevator waits for an RCU grace period.
Commit 245a489 ("block: avoid to quiesce queue in
elevator_init_mq") had removed this wait from the default elevator
setup, and it came back when that setup was folded into
elevator_change().

The wait is paid in full by callers that add disks one at a time. ublk
adds the disk of a single-queue device from START_DEV, which takes 7.7ms
at p50 in a 16 vCPU KVM guest, most of it in blk_mq_quiesce_queue()
called from elevator_set_default().

Skip quiescing in elevator_switch() when setting the default elevator.

ublk null target, 1000 single-queue devices created one by one:

                     before      after
  START_DEV p50      7.74ms     0.68ms
  START_DEV p99     14.61ms     1.32ms
  devices/s             114        971

Fixes: 1e44bed ("block: unifying elevator change")
Cc: stable@vger.kernel.org
Signed-off-by: Qiliang Yuan <odys.yuan@gmail.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Commit f8e111c ("block: don't call freeze queue in
elevator_switch() and elevator_disable()") moved freezing the queue
out of elevator_switch() into its callers, but kept the out_unfreeze
label, which used to unquiesce and unfreeze the queue.

The code at the label now unquiesces the queue but never unfreezes it,
so the name is misleading.

Rename the label to out_unquiesce.

Suggested-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Qiliang Yuan <odys.yuan@gmail.com>
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: b3dfbde
series: https://patchwork.kernel.org/series/1186034/
version: 2

@ghost
ghost force-pushed the series/1186034=>linus-master branch from 806bdcd to b7f4558 Compare November 10, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants