hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/kernel/sched/cpufreq.c
....@@ -1,18 +1,16 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Scheduler code and data structures related to cpufreq.
34 *
45 * Copyright (C) 2016, Intel Corporation
56 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118 #include <linux/cpufreq.h>
129
1310 #include "sched.h"
1411
15
-DEFINE_PER_CPU(struct update_util_data *, cpufreq_update_util_data);
12
+DEFINE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data);
13
+EXPORT_PER_CPU_SYMBOL_GPL(cpufreq_update_util_data);
1614
1715 /**
1816 * cpufreq_add_update_util_hook - Populate the CPU's update_util_data pointer.
....@@ -53,8 +51,8 @@
5351 *
5452 * Clear the update_util_data pointer for the given CPU.
5553 *
56
- * Callers must use RCU-sched callbacks to free any memory that might be
57
- * accessed via the old update_util_data pointer or invoke synchronize_sched()
54
+ * Callers must use RCU callbacks to free any memory that might be
55
+ * accessed via the old update_util_data pointer or invoke synchronize_rcu()
5856 * right after this function to avoid use-after-free.
5957 */
6058 void cpufreq_remove_update_util_hook(int cpu)
....@@ -78,3 +76,4 @@
7876 (policy->dvfs_possible_from_any_cpu &&
7977 rcu_dereference_sched(*this_cpu_ptr(&cpufreq_update_util_data)));
8078 }
79
+EXPORT_SYMBOL_GPL(cpufreq_this_cpu_can_update);