Skip to content

blk-mq: allow passthrough requests on hctxs without online CPUs - #13

Open
ghost wants to merge 1 commit into
for-next_basefrom
series/1201857=>for-next
Open

ghost wants to merge 1 commit into
for-next_basefrom
series/1201857=>for-next

Conversation

@ghost

@ghost ghost commented Nov 10, 2026

Copy link
Copy Markdown

Pull request for series with
subject: blk-mq: allow passthrough requests on hctxs without online CPUs
version: 3
url: https://patchwork.kernel.org/series/1201857/

@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1201857/
version: 3

@ghost
ghost force-pushed the for-next_base branch from 8c33852 to 18eb5ad Compare November 10, 2026 10:19
blk_mq_alloc_request_hctx() picks the first online CPU in hctx->cpumask
to find a software context for the request. If no CPU in the mask is
online, allocation fails with -EXDEV.

This triggers in two scenarios:

 1. Commit 20e4d81 ("blk-mq: simplify queue mapping & schedule with
    each possisble CPU") maps all possible CPUs to hardware contexts. If
    certain CPUs are offline (e.g. booted with maxcpus= or offlined via
    sysfs), a hardware context may end up mapped entirely to offline CPUs.

 2. Commit a46c270 ("blk-mq: don't schedule block kworker on
    isolated CPUs") strips isolated CPUs from hctx->cpumask. If an hctx
    is mapped exclusively to isolated CPUs (isolcpus=domain or an isolated
    cpuset partition), hctx->cpumask ends up empty.

NVMe fabrics transports allocate the Connect command for each I/O queue
using blk_mq_alloc_request_hctx(). If an hctx only maps offline or
isolated CPUs, connecting to the controller fails. Skipping these queues
is not an option because isolated CPUs still submit I/O through them,
as will offline CPUs once brought online.

Passthrough requests bypass the software staging queues and dispatch
directly. For these requests, the software context only serves to pick
a completion CPU and provide a hint when releasing the tag.

Fall back to an online housekeeping CPU's software context when allocating
passthrough requests on an hctx without an online CPU in its mask.

Hardware contexts whose last online CPU went offline are inactive.
blk-mq drained them for the CPU offline, so allocations on them still
fail.

Fixes: 20e4d81 ("blk-mq: simplify queue mapping & schedule with each possisble CPU")
Fixes: a46c270 ("blk-mq: don't schedule block kworker on isolated CPUs")
Tested-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1201857/
version: 3

@ghost
ghost force-pushed the series/1201857=>for-next branch from 83b0a04 to 84517e6 Compare November 10, 2026 10:24
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.

1 participant