Re: [PATCH v15 5/8] blk-mq: use hk cpus only when isolcpus=io_queue is enabled

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

On Fri, May 22, 2026 at 1:30 AM Aaron Tomlin <[email protected]> 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
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.