summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-02-18 19:04:25 +0300
committerEduardo Valentin <edubezval@gmail.com>2015-05-05 07:27:51 +0300
commitbcdcbbc71125c37195f97314f453ca9a3a4eb758 (patch)
tree886c2d24fab01346384d956f8f4c874a626ab3c7 /include
parentdb91651311c8b89978b17d27634582c28c33363e (diff)
downloadlinux-bcdcbbc71125c37195f97314f453ca9a3a4eb758.tar.xz
thermal: fair_share: generalize the weight concept
The fair share governor has the concept of weights, which is the influence of each cooling device in a thermal zone. The current implementation forces the weights of all cooling devices in a thermal zone to add up to a 100. This complicates setups, as you need to know in advance how many cooling devices you are going to have. If you bind a new cooling device, you have to modify all the other cooling devices weights, which is error prone. Furthermore, you can't specify a "default" weight for platforms since that default value depends on the number of cooling devices in the platform. This patch generalizes the concept of weight by allowing any number to be a "weight". Weights are now relative to each other. Platforms that don't specify weights get the same default value for all their cooling devices, so all their cdevs are considered to be equally influential. It's important to note that previous users of the weights don't need to alter the code: percentages continue to work as they used to. This patch just removes the constraint of all the weights in a thermal zone having to add up to a 100. If they do, you get the same behavior as before. If they don't, fair share now works for that platform. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Durgadoss R <durgadoss.r@intel.com> Acked-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/thermal.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 00dacd4dfdce..bac0f52c7a1e 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -217,9 +217,12 @@ struct thermal_bind_params {
/*
* This is a measure of 'how effectively these devices can
- * cool 'this' thermal zone. The shall be determined by platform
- * characterization. This is on a 'percentage' scale.
- * See Documentation/thermal/sysfs-api.txt for more information.
+ * cool 'this' thermal zone. It shall be determined by
+ * platform characterization. This value is relative to the
+ * rest of the weights so a cooling device whose weight is
+ * double that of another cooling device is twice as
+ * effective. See Documentation/thermal/sysfs-api.txt for more
+ * information.
*/
int weight;