Re: [PATCH v15 6/8] blk-mq: prevent offlining hk CPUs with associated online isolated CPUs
From: Marco Crivellari
Date: Tue Jul 21 2026 - 10:32:02 EST
Hi,
On Fri, May 22, 2026 at 1:30 AM Aaron Tomlin <atomlin@xxxxxxxxxxx> wrote:
> [...]
> static bool blk_mq_hctx_has_online_cpu(struct blk_mq_hw_ctx *hctx,
> unsigned int this_cpu)
> {
> @@ -3771,6 +3821,11 @@ static int blk_mq_hctx_notify_offline(unsigned int cpu, struct hlist_node *node)
> struct blk_mq_hw_ctx, cpuhp_online);
> int ret = 0;
>
> + if (housekeeping_enabled(HK_TYPE_IO_QUEUE)) {
> + if (!blk_mq_hctx_can_offline_hk_cpu(hctx, cpu))
> + return -EINVAL;
> + }
> +
> if (!hctx->nr_ctx || blk_mq_hctx_has_online_cpu(hctx, cpu))
> return 0;
I noticed the existing `if` returns 0, while the added code returns
-EINVAL. I'm wondering if this will prevent the system from suspending
because of the -EINVAL error.
Should ` !cpuhp_tasks_frozen` be added to the if statement?
eg.
if (housekeeping_enabled(HK_TYPE_IO_QUEUE) && !cpuhp_tasks_frozen) {
if (!blk_mq_hctx_can_offline_hk_cpu(hctx, cpu))
return -EINVAL;
}
Or maybe just handling this inside blk_mq_hctx_can_offline_hk_cpu()
returning true.
Does it make sense?
Thanks!
--
Marco Crivellari
SUSE Labs