Skip to content

Commit 844d878

Browse files
Sebastian Andrzej SiewiorKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 36a21d5 commit 844d878

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/smpboot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
291291
unsigned int cpu;
292292
int ret = 0;
293293

294-
get_online_cpus();
294+
cpus_read_lock();
295295
mutex_lock(&smpboot_threads_lock);
296296
for_each_online_cpu(cpu) {
297297
ret = __smpboot_create_thread(plug_thread, cpu);
@@ -304,7 +304,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
304304
list_add(&plug_thread->list, &hotplug_threads);
305305
out:
306306
mutex_unlock(&smpboot_threads_lock);
307-
put_online_cpus();
307+
cpus_read_unlock();
308308
return ret;
309309
}
310310
EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);
@@ -317,12 +317,12 @@ EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);
317317
*/
318318
void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread)
319319
{
320-
get_online_cpus();
320+
cpus_read_lock();
321321
mutex_lock(&smpboot_threads_lock);
322322
list_del(&plug_thread->list);
323323
smpboot_destroy_threads(plug_thread);
324324
mutex_unlock(&smpboot_threads_lock);
325-
put_online_cpus();
325+
cpus_read_unlock();
326326
}
327327
EXPORT_SYMBOL_GPL(smpboot_unregister_percpu_thread);
328328

0 commit comments

Comments
 (0)