Commit 684e185
committed
cpufreq: Introduce cpufreq_policy_refresh()
Since cpufreq_update_limits() obtains a cpufreq policy pointer for the
given CPU and reference counts the object pointed to by it, calling
cpufreq_update_policy() from cpufreq_update_limits() is somewhat
wasteful because that function calls cpufreq_cpu_get() on the same
CPU again.
To avoid that unnecessary overhead, move the part of the code running
under the policy rwsem from cpufreq_update_policy() to a new function
called cpufreq_policy_refresh() and invoke that new function from
both cpufreq_update_policy() and cpufreq_update_limits().
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://patch.msgid.link/6047110.MhkbZ0Pkbq@rjwysocki.net1 parent ece898d commit 684e185
1 file changed
+18
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2717 | 2717 | | |
2718 | 2718 | | |
2719 | 2719 | | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
2720 | 2735 | | |
2721 | 2736 | | |
2722 | 2737 | | |
| |||
2734 | 2749 | | |
2735 | 2750 | | |
2736 | 2751 | | |
2737 | | - | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
2743 | | - | |
2744 | | - | |
2745 | | - | |
2746 | | - | |
2747 | | - | |
| 2752 | + | |
2748 | 2753 | | |
2749 | 2754 | | |
2750 | 2755 | | |
| |||
2753 | 2758 | | |
2754 | 2759 | | |
2755 | 2760 | | |
2756 | | - | |
| 2761 | + | |
2757 | 2762 | | |
2758 | 2763 | | |
2759 | 2764 | | |
| |||
2766 | 2771 | | |
2767 | 2772 | | |
2768 | 2773 | | |
2769 | | - | |
| 2774 | + | |
2770 | 2775 | | |
2771 | 2776 | | |
2772 | 2777 | | |
| |||
0 commit comments