Re: [PATCH v5] blk-mq: dispatch kworker to housekeeping CPU when hctx cpumask is empty
From: Marco Crivellari
Date: Mon Nov 23 2026 - 05:48:06 EST
Hi Aaron,
On Sun, Nov 22, 2026 at 12:52 AM Aaron Tomlin <atomlin@xxxxxxxxxxx> wrote:
>
> [...] In real-time environments, an active SCHED_FIFO workload will
> starve this SCHED_NORMAL worker and stall hardware dispatch, whilst also
> introducing unwanted latency jitter on nohz_full cores, defeating that
> commit's original objective.
I would phrase this differently. cpu_is_isolated() checks HK_TYPE_DOMAIN,
so the jitter argument holds only when the nohz_full CPU is also
domain isolated (isolcpus=domain or an isolated cpuset partition). With
nohz_full alone, or isolcpus=nohz without domain, this patch does not
apply and the behavior is unchanged.
> +static inline int blk_mq_hctx_unbound_cpu(void)
> +{
> +#ifdef CONFIG_CPU_ISOLATION
> + if (static_branch_unlikely(&housekeeping_overridden)) {
> + int cpu;
> +
> + guard(preempt)();
> + if (!cpu_is_isolated(raw_smp_processor_id()))
> + return WORK_CPU_UNBOUND;
Since preemption is disabled by guard(preempt)(), you can use
smp_processor_id() here instead of raw_smp_processor_id().
Thanks!
--
Marco Crivellari
SUSE Labs