.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * Scheduler code and data structures related to cpufreq. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2016, Intel Corporation |
---|
5 | 6 | * 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. |
---|
10 | 7 | */ |
---|
11 | 8 | #include <linux/cpufreq.h> |
---|
12 | 9 | |
---|
13 | 10 | #include "sched.h" |
---|
14 | 11 | |
---|
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); |
---|
16 | 14 | |
---|
17 | 15 | /** |
---|
18 | 16 | * cpufreq_add_update_util_hook - Populate the CPU's update_util_data pointer. |
---|
.. | .. |
---|
53 | 51 | * |
---|
54 | 52 | * Clear the update_util_data pointer for the given CPU. |
---|
55 | 53 | * |
---|
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() |
---|
58 | 56 | * right after this function to avoid use-after-free. |
---|
59 | 57 | */ |
---|
60 | 58 | void cpufreq_remove_update_util_hook(int cpu) |
---|
.. | .. |
---|
78 | 76 | (policy->dvfs_possible_from_any_cpu && |
---|
79 | 77 | rcu_dereference_sched(*this_cpu_ptr(&cpufreq_update_util_data))); |
---|
80 | 78 | } |
---|
| 79 | +EXPORT_SYMBOL_GPL(cpufreq_this_cpu_can_update); |
---|