Re: [PATCH v15 6/8] blk-mq: prevent offlining hk CPUs with associated online isolated CPUs
Aaron Tomlin <[email protected]> Wed, 5 Aug 2026 15:20:26 -0400
| Newsgroups | org.kernel.vger.linux-block,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <ujlw6w6npcy7hgmtdqqzjuy36l2cd7l2y7sxoq2fwhyujy6756@gabfeibsggym> |
On Tue, Jul 21, 2026 at 04:19:26PM +0200, Marco Crivellari wrote: > 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? Hi Marco, Absolutely! During system suspend/hibernation I/O is quiesced, and all CPUs are being taken down for system sleep. Returning -EINVAL breaks system power management. Offlining must be allowed to proceed. Yes, we should test for cpuhp_tasks_frozen in blk_mq_hctx_can_offline_hk_cpu(). Kind regards, -- Aaron Tomlin