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
521 struct shuffle_task *stp;521 struct shuffle_task *stp;
522 522
523 cpumask_setall(shuffle_tmp_mask);523 cpumask_setall(shuffle_tmp_mask);
524 get_online_cpus();524 cpus_read_lock();
525 525
526 /* No point in shuffling if there is only one online CPU (ex: UP) */526 /* No point in shuffling if there is only one online CPU (ex: UP) */
527 if (num_online_cpus() == 1) {527 if (num_online_cpus() == 1) {
528 put_online_cpus();528 cpus_read_unlock();
529 return;529 return;
530 }530 }
531 531
@@ -541,7 +541,7 @@ static void torture_shuffle_tasks(void) · 9 unmodified lines
541 set_cpus_allowed_ptr(stp->st_t, shuffle_tmp_mask);541 set_cpus_allowed_ptr(stp->st_t, shuffle_tmp_mask);
542 mutex_unlock(&shuffle_task_mutex);542 mutex_unlock(&shuffle_task_mutex);
543 543
544 put_online_cpus();544 cpus_read_unlock();
545}545}
546 546
547/* Shuffle tasks across CPUs, with the intent of allowing each CPU in the547/* Shuffle tasks across CPUs, with the intent of allowing each CPU in the