aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_governor.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-02-14 20:13:42 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 08:41:03 -0500
commite4db2813d2e558b6b6bee464308678a57732b390 (patch)
tree2cd9422569ce684971136492b12323d40c3e0a26 /drivers/cpufreq/cpufreq_governor.h
parentf62b93740c30d0a3f50258d45415f00b763dd70a (diff)
cpufreq: governor: Avoid atomic operations in hot paths
Rework the handling of work items by dbs_update_util_handler() and dbs_work_handler() so the former (which is executed in scheduler paths) only uses atomic operations when absolutely necessary. That is, when the policy is shared and dbs_update_util_handler() has already decided that this is the time to queue up a work item. In particular, this avoids the atomic ops entirely on platforms where policy objects are never shared. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq_governor.h')
-rw-r--r--drivers/cpufreq/cpufreq_governor.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
index 8138eff5e25b..521daac38ba5 100644
--- a/drivers/cpufreq/cpufreq_governor.h
+++ b/drivers/cpufreq/cpufreq_governor.h
@@ -130,6 +130,9 @@ struct policy_dbs_info {
130 /* dbs_data may be shared between multiple policy objects */ 130 /* dbs_data may be shared between multiple policy objects */
131 struct dbs_data *dbs_data; 131 struct dbs_data *dbs_data;
132 struct list_head list; 132 struct list_head list;
133 /* Status indicators */
134 bool is_shared; /* This object is used by multiple CPUs */
135 bool work_in_progress; /* Work is being queued up or in progress */
133}; 136};
134 137
135static inline void gov_update_sample_delay(struct policy_dbs_info *policy_dbs, 138static inline void gov_update_sample_delay(struct policy_dbs_info *policy_dbs,