smpboot: Replace deprecated CPU-hotplug functions.
The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20210803141621.780504-34-bigeasy@linutronix.de
This commit is contained in:
parent
36a21d5172
commit
844d87871b
@ -291,7 +291,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
|
|||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
get_online_cpus();
|
cpus_read_lock();
|
||||||
mutex_lock(&smpboot_threads_lock);
|
mutex_lock(&smpboot_threads_lock);
|
||||||
for_each_online_cpu(cpu) {
|
for_each_online_cpu(cpu) {
|
||||||
ret = __smpboot_create_thread(plug_thread, cpu);
|
ret = __smpboot_create_thread(plug_thread, cpu);
|
||||||
@ -304,7 +304,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
|
|||||||
list_add(&plug_thread->list, &hotplug_threads);
|
list_add(&plug_thread->list, &hotplug_threads);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&smpboot_threads_lock);
|
mutex_unlock(&smpboot_threads_lock);
|
||||||
put_online_cpus();
|
cpus_read_unlock();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);
|
EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);
|
||||||
@ -317,12 +317,12 @@ EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);
|
|||||||
*/
|
*/
|
||||||
void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread)
|
void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread)
|
||||||
{
|
{
|
||||||
get_online_cpus();
|
cpus_read_lock();
|
||||||
mutex_lock(&smpboot_threads_lock);
|
mutex_lock(&smpboot_threads_lock);
|
||||||
list_del(&plug_thread->list);
|
list_del(&plug_thread->list);
|
||||||
smpboot_destroy_threads(plug_thread);
|
smpboot_destroy_threads(plug_thread);
|
||||||
mutex_unlock(&smpboot_threads_lock);
|
mutex_unlock(&smpboot_threads_lock);
|
||||||
put_online_cpus();
|
cpus_read_unlock();
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(smpboot_unregister_percpu_thread);
|
EXPORT_SYMBOL_GPL(smpboot_unregister_percpu_thread);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user