From: Jens Axboe <axboe@kernel.dk>
To: Aaron Tomlin <atomlin@atomlin.com>
Cc: tom.leiming@gmail.com, hare@suse.de, dwagner@suse.de,
frederic@kernel.org, tj@kernel.org, sean@ashe.io,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3] blk-mq: dispatch kworker to housekeeping CPU when hctx cpumask is empty
Date: Tue, 20 Oct 2026 09:23:10 -0600 [thread overview]
Message-ID: <694b548c-5f34-48f2-8ccc-5aa020c76939@kernel.dk> (raw)
In-Reply-To: <20261016052203.489760-1-atomlin@atomlin.com>
On 10/15/26 11:22 PM, Aaron Tomlin wrote:
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 025a799f35b9..1a113679f15b 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2241,6 +2241,21 @@ static bool blk_mq_hctx_empty_cpumask(struct blk_mq_hw_ctx *hctx)
> return hctx->next_cpu >= nr_cpu_ids;
> }
>
> +static inline int blk_mq_hctx_unbound_cpu(void)
> +{
> + if (cpu_is_isolated(raw_smp_processor_id())) {
> + int cpu;
> +
> + guard(rcu)();
> +
> + cpu = cpumask_any_and_distribute(housekeeping_cpumask(HK_TYPE_DOMAIN),
> + cpu_online_mask);
> + if (cpu < nr_cpu_ids)
> + return cpu;
> + }
> + return WORK_CPU_UNBOUND;
> +}
Not opposed to this, but let's please think about making the
common case the fast path. CPU isolation is not the common
path. That might mean annotating the hctx itself.
--
Jens Axboe
prev parent reply other threads:[~2026-10-20 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 5:22 Aaron Tomlin
2026-10-20 15:09 ` Daniel Wagner
2026-10-20 15:23 ` Jens Axboe [this message]
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=694b548c-5f34-48f2-8ccc-5aa020c76939@kernel.dk \
--to=axboe@kernel.dk \
--cc=atomlin@atomlin.com \
--cc=dwagner@suse.de \
--cc=frederic@kernel.org \
--cc=hare@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sean@ashe.io \
--cc=stable@vger.kernel.org \
--cc=tj@kernel.org \
--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®