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.
Unified · Split
| @@ -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 the | 547 | /* Shuffle tasks across CPUs, with the intent of allowing each CPU in the |