Skip to content

Commit

Permalink
torture: Replace deprecated CPU-hotplug functions.
Browse files Browse the repository at this point in the history
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.

Cc: Davidlohr Bueso <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Josh Triplett <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
Sebastian Andrzej Siewior authored and paulmckrcu committed Aug 10, 2021
1 parent 586e4d4 commit ed4fa24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/torture.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,11 @@ static void torture_shuffle_tasks(void)
struct shuffle_task *stp;

cpumask_setall(shuffle_tmp_mask);
get_online_cpus();
cpus_read_lock();

/* No point in shuffling if there is only one online CPU (ex: UP) */
if (num_online_cpus() == 1) {
put_online_cpus();
cpus_read_unlock();
return;
}

Expand All @@ -541,7 +541,7 @@ static void torture_shuffle_tasks(void)
set_cpus_allowed_ptr(stp->st_t, shuffle_tmp_mask);
mutex_unlock(&shuffle_task_mutex);

put_online_cpus();
cpus_read_unlock();
}

/* Shuffle tasks across CPUs, with the intent of allowing each CPU in the
Expand Down

0 comments on commit ed4fa24

Please sign in to comment.