Skip to content

Commit b290ebc

Browse files
author
Paul E. McKenney
committed
sched: Replace synchronize_sched() with synchronize_rcu()
Now that synchronize_rcu() waits for preempt-disable regions of code as well as RCU read-side critical sections, synchronize_sched() can be replaced by synchronize_rcu(), in fact, synchronize_sched() is now completely equivalent to synchronize_rcu(). This commit therefore replaces synchronize_sched() with synchronize_rcu() so that synchronize_sched() can eventually be removed entirely. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org>
1 parent 337e9b0 commit b290ebc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎kernel/sched/cpufreq.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ EXPORT_SYMBOL_GPL(cpufreq_add_update_util_hook);
4848
*
4949
* Clear the update_util_data pointer for the given CPU.
5050
*
51-
* Callers must use RCU-sched callbacks to free any memory that might be
52-
* accessed via the old update_util_data pointer or invoke synchronize_sched()
51+
* Callers must use RCU callbacks to free any memory that might be
52+
* accessed via the old update_util_data pointer or invoke synchronize_rcu()
5353
* right after this function to avoid use-after-free.
5454
*/
5555
void cpufreq_remove_update_util_hook(int cpu)

‎kernel/sched/cpufreq_schedutil.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ static void sugov_stop(struct cpufreq_policy *policy)
859859
for_each_cpu(cpu, policy->cpus)
860860
cpufreq_remove_update_util_hook(cpu);
861861

862-
synchronize_sched();
862+
synchronize_rcu();
863863

864864
if (!policy->fast_switch_enabled) {
865865
irq_work_sync(&sg_policy->irq_work);

0 commit comments

Comments
 (0)