aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/governors/menu.c
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2013-08-14 12:02:40 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-22 18:24:16 -0400
commitdecd51bbcd7fd949840da4cc634f6b70baa1b512 (patch)
tree485397f9381802ae28b96e4a018a33c52cfcd8f8 /drivers/cpuidle/governors/menu.c
parent0e96d5adcfef22f86e4463909728d63f88944749 (diff)
cpuidle: Add a comment warning about possible overflow
The menu governor has a number of tunable constants that may be changed in the source. If certain combination of values are chosen, an overflow is possible when the correction_factor is being recalculated. This patch adds a warning regarding this possibility and describes the change needed for fixing the issue. The change should not be permanently enabled, as it will hurt performance when it is not needed. Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/governors/menu.c')
-rw-r--r--drivers/cpuidle/governors/menu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index a56081ce170f..a8b31b0ca57f 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -21,6 +21,15 @@
21#include <linux/math64.h> 21#include <linux/math64.h>
22#include <linux/module.h> 22#include <linux/module.h>
23 23
24/*
25 * Please note when changing the tuning values:
26 * If (MAX_INTERESTING-1) * RESOLUTION > UINT_MAX, the result of
27 * a scaling operation multiplication may overflow on 32 bit platforms.
28 * In that case, #define RESOLUTION as ULL to get 64 bit result:
29 * #define RESOLUTION 1024ULL
30 *
31 * The default values do not overflow.
32 */
24#define BUCKETS 12 33#define BUCKETS 12
25#define INTERVALS 8 34#define INTERVALS 8
26#define RESOLUTION 1024 35#define RESOLUTION 1024