lkml.org 
[lkml]   [2023]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V3] lib/group_cpus.c: avoid to acquire cpu hotplug lock in group_cpus_evenly
Date
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

\
 
 \ /
  Last update: 2023-08-31 11:04    [W:0.032 / U:1.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site