Re: [RFC PATCH v1] blk-mq: isolate CPUs from hctx

From: Waiman Long
Date: Fri Nov 15 2024 - 17:42:35 EST



On 11/15/24 3:25 PM, Costa Shulyupin wrote:
Hello Michal.

Isolation of CPUs from blk_mq_hw_ctx during boot is already handled on
call hierarchy:
...
nvme_probe()
nvme_alloc_admin_tag_set()
blk_mq_alloc_queue()
blk_mq_init_allocated_queue()
blk_mq_map_swqueue()

blk_mq_map_swqueue() performs:
for_each_cpu(cpu, hctx->cpumask) {
if (cpu_is_isolated(cpu))
cpumask_clear_cpu(cpu, hctx->cpumask);
}

static inline bool cpu_is_isolated(int cpu)
{
return !housekeeping_test_cpu(cpu, HK_TYPE_DOMAIN) ||
!housekeeping_test_cpu(cpu, HK_TYPE_TICK) ||
cpuset_cpu_is_isolated(cpu);
}

cpuset_cpu_is_isolated() can be removed once the cpumasks can be changed dynamically.

Cheers,
Longman