Re: [PATCH v15 5/8] blk-mq: use hk cpus only when isolcpus=io_queue is enabled
From: Marco Crivellari
Date: Tue Jul 21 2026 - 06:35:20 EST
Hi,
On Fri, May 22, 2026 at 1:30 AM Aaron Tomlin <atomlin@xxxxxxxxxxx> wrote:
> + void blk_mq_map_queues(struct blk_mq_queue_map *qmap)
> [..]
> + /*
> + * Snapshot online CPUs to prevent TOCTOU races between the
> + * mapping phase and the validation phase.
> + */
> + cpumask_copy(online_mask, cpu_online_mask);
I'm wondering: should this code be protected somehow, maybe directly
by the caller (eg w/ cpus_read_lock()) to avoid a CPU going offline eg
after the copy?
This invalidates the copy because a CPU set there might have gone
offline, and the blk code would then still use that CPU.
Does that make sense or it is not the case?
Thanks!
--
Marco Crivellari
SUSE Labs