Re: [PATCH v15 6/8] blk-mq: prevent offlining hk CPUs with associated online isolated CPUs

Marco Crivellari <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel
Message-ID <CAAofZF6z-m9oikO6CEd_VUeBmgEq08E5RW0ED9C9m+xanOsdSg@mail.gmail.com>
Hi,

On Fri, May 22, 2026 at 1:30 AM Aaron Tomlin <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.