diff options
author | Sai Gurrappadi <sgurrappadi@nvidia.com> | 2013-12-19 16:30:02 -0800 |
---|---|---|
committer | Diwakar Tundlam <dtundlam@nvidia.com> | 2014-02-27 15:55:16 -0800 |
commit | c7960b345acf19b488fc09ed6c462f727aa13657 (patch) | |
tree | 7044a871a3363345fc6587a052a3d520e805d301 /drivers/cpuquiet/governors | |
parent | a13cb3238604d9133c3bdb74d41571f6aad48584 (diff) |
cpuquiet: Support X cpus for runnables governor
Runnables govenror will now work properly for any number of cpus as
defined by NR_CPUS. Switched the ordering of nr_run_threshold init to
ensure that array is initialized correctly to UINT_MAX for NR_CPUS-1 cpu.
Bug 1427140
Change-Id: Ic612406ceaf80dd7e0b6693906df339f8b6512aa
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/369016
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/cpuquiet/governors')
-rw-r--r-- | drivers/cpuquiet/governors/runnable_threads.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpuquiet/governors/runnable_threads.c b/drivers/cpuquiet/governors/runnable_threads.c index f20b8c71e384..77ce4b88566b 100644 --- a/drivers/cpuquiet/governors/runnable_threads.c +++ b/drivers/cpuquiet/governors/runnable_threads.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2012-2014 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -284,10 +284,10 @@ static int runnables_start(void) runnables_timer.function = runnables_avg_sampler; for(i = 0; i < ARRAY_SIZE(nr_run_thresholds); ++i) { - if (i < ARRAY_SIZE(default_thresholds)) - nr_run_thresholds[i] = default_thresholds[i]; - else if (i == (ARRAY_SIZE(nr_run_thresholds) - 1)) + if (i == (ARRAY_SIZE(nr_run_thresholds) - 1)) nr_run_thresholds[i] = UINT_MAX; + else if (i < ARRAY_SIZE(default_thresholds)) + nr_run_thresholds[i] = default_thresholds[i]; else nr_run_thresholds[i] = i + 1 + NR_FSHIFT / default_threshold_level; |