History

torture: 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.

Sebastian Andrzej Siewior committed 5 years ago

Commit ed4fa241 parent 586e4d41 file · +3 −3Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/torture.c+3−3
@@ -521,11 +521,11 @@ static void torture_shuffle_tasks(void) · 520 unmodified lines
521521 struct shuffle_task *stp;
522522
523523 cpumask_setall(shuffle_tmp_mask);
524− get_online_cpus();
524+ cpus_read_lock();
525525
526526 /* No point in shuffling if there is only one online CPU (ex: UP) */
527527 if (num_online_cpus() == 1) {
528− put_online_cpus();
528+ cpus_read_unlock();
529529 return;
530530 }
531531
@@ -541,7 +541,7 @@ static void torture_shuffle_tasks(void) · 9 unmodified lines
541541 set_cpus_allowed_ptr(stp->st_t, shuffle_tmp_mask);
542542 mutex_unlock(&shuffle_task_mutex);
543543
544− put_online_cpus();
544+ cpus_read_unlock();
545545 }
546546
547547 /* Shuffle tasks across CPUs, with the intent of allowing each CPU in the