On Wed, Feb 18 2026 at 14:09, Vishal Chourasia wrote: > From: Joel Fernandes <[email protected]> > > Bulk CPU hotplug operations, such as an SMT switch operation, requires > hotplugging multiple CPUs. The current implementation takes > cpus_write_lock() for each individual CPU, causing multiple slow grace > period requests. > > Introduce cpu_up_locked() and cpu_down_locked() that assume the caller > already holds cpus_write_lock(). The cpuhp_smt_enable() and > cpuhp_smt_disable() functions are updated to hold the lock once around > the entire loop, rather than for each individual CPU. > > Link: > https://lore.kernel.org/all/[email protected]/ > Suggested-by: Peter Zijlstra <[email protected]> > Signed-off-by: Vishal Chourasia <[email protected]>
You dropped Joel's Signed-off-by .... > -/* Requires cpu_add_remove_lock to be held */ > -static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, > +/* Requires cpu_add_remove_lock and cpus_write_lock to be held */ > +static int __ref cpu_down_locked(unsigned int cpu, int tasks_frozen, > enum cpuhp_state target) No line break required. You have 100 chars. If you still need one: https://www.kernel.org/doc/html/latest/process/maintainer-tip.html > */ > if (cpumask_any_and(cpu_online_mask, > housekeeping_cpumask(HK_TYPE_DOMAIN)) >= > nr_cpu_ids) { > - ret = -EBUSY; > - goto out; > + return -EBUSY; > } Please remove the brackets. They are not longer required. All over the place. > +static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, > + enum cpuhp_state target) > +{ > + > + int ret; > + cpus_write_lock(); Coding style... > + ret = cpu_down_locked(cpu, tasks_frozen, target); > cpus_write_unlock(); > arch_smt_update(); > return ret; > @@ -2659,6 +2674,16 @@ int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) > int cpu, ret = 0; > > cpu_maps_update_begin(); > + if (cpu_hotplug_offline_disabled) { > + ret = -EOPNOTSUPP; > + goto out; > + } > + if (cpu_hotplug_disabled) { > + ret = -EBUSY; > + goto out; > + } > + /* Hold cpus_write_lock() for entire batch operation. */ > + cpus_write_lock(); .... for the entire ... And please visiually separate things. Newlines exist for a reason. Thanks, tglx

