sched: Replace synchronize_sched() with synchronize_rcu()
authorPaul E. McKenney <paulmck@linux.ibm.com>
Wed, 7 Nov 2018 03:13:54 +0000 (19:13 -0800)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Fri, 25 Jan 2019 23:28:22 +0000 (15:28 -0800)
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>
kernel/sched/cpufreq.c
kernel/sched/cpufreq_schedutil.c

index 22bd898..835671f 100644 (file)
@@ -48,8 +48,8 @@ EXPORT_SYMBOL_GPL(cpufreq_add_update_util_hook);
  *
  * Clear the update_util_data pointer for the given CPU.
  *
- * Callers must use RCU-sched callbacks to free any memory that might be
- * accessed via the old update_util_data pointer or invoke synchronize_sched()
+ * Callers must use RCU callbacks to free any memory that might be
+ * accessed via the old update_util_data pointer or invoke synchronize_rcu()
  * right after this function to avoid use-after-free.
  */
 void cpufreq_remove_update_util_hook(int cpu)
index 033ec7c..2efe629 100644 (file)
@@ -859,7 +859,7 @@ static void sugov_stop(struct cpufreq_policy *policy)
        for_each_cpu(cpu, policy->cpus)
                cpufreq_remove_update_util_hook(cpu);
 
-       synchronize_sched();
+       synchronize_rcu();
 
        if (!policy->fast_switch_enabled) {
                irq_work_sync(&sg_policy->irq_work);