[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87zg274m8u.ffs@tglx>
Date: Thu, 31 Aug 2023 11:03:29 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Ming Lei <ming.lei@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org,
Keith Busch <kbusch@...nel.org>,
linux-nvme@...ts.infradead.org, linux-block@...r.kernel.org,
Yi Zhang <yi.zhang@...hat.com>,
Guangwu Zhang <guazhang@...hat.com>,
Chengming Zhou <zhouchengming@...edance.com>
Subject: Re: [PATCH V3] lib/group_cpus.c: avoid to acquire cpu hotplug lock
in group_cpus_evenly
Ming!
On Thu, Aug 31 2023 at 16:15, Ming Lei wrote:
> On Wed, Aug 30, 2023 at 07:44:03PM +0200, Thomas Gleixner wrote:
> There isn't difference compared with holding cpu hotplug lock, because
> the cpu hp state is always changed even though cpu_present_mask isn't
> updated with the lock.
Updates to cpu_present_mask happen with the cpus lock write locked:
acpi_processor_hotadd_init()
cpu_maps_update_begin()
cpus_write_lock()
acpi_map_cpu()
generic_processor_info()
set_cpu_present(cpu, true);
The only CPU mask which is lockless race free accessible is
cpus_possible_mask because that one is set up at boot once and never
modified afterwards.
> And all CPUs are always covered during the spread, the difference
> is just that it is done in 1st stage or 2nd stage.
I'm not objecting against the approach per se. It just needs proper
documentation why this is correct.
Thanks,
tglx
Powered by blists - more mailing lists