summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@codeaurora.org>2014-08-11 09:54:04 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:00:25 -0700
commit32e4c4a368fed944f7c92a7cb7cf96223b7f599d (patch)
treeaf2573332f4c8260393553c7cdf262309820a0a0
parente39131c3bece6c558bf6a10792654f6c62b9fed8 (diff)
sched: window-stats: Code cleanup
Collapse duplicated comments about keeping few of sysctl knobs initialized to same value as their non-sysctl copies Change-Id: Idc8261d86b9f36e5f2f2ab845213bae268ae9028 Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
-rw-r--r--kernel/sched/core.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index aa54ab69aaf0..17d5f7a6b205 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1162,16 +1162,26 @@ static inline void clear_hmp_request(int cpu) { }
#if defined(CONFIG_SCHED_FREQ_INPUT) || defined(CONFIG_SCHED_HMP)
-__read_mostly unsigned int sysctl_sched_ravg_hist_size = 5;
-
/*
- * copy of sysctl_sched_ravg_hist_size. Required for atomically
- * changing the ravg history size (see sched_ravg_hist_size_update_handler()
- * for details).
+ * sched_window_stats_policy, sched_account_wait_time and sched_ravg_hist_size
+ * have a 'sysctl' copy associated with them. This is required for atomic update
+ * of those variables when being modifed via sysctl interface.
*
- * Initialize both to same value!!
+ * IMPORTANT: Initialize both copies to same value!!
*/
+
static __read_mostly unsigned int sched_ravg_hist_size = 5;
+__read_mostly unsigned int sysctl_sched_ravg_hist_size = 5;
+
+
+static __read_mostly unsigned int sched_window_stats_policy =
+ WINDOW_STATS_USE_AVG;
+__read_mostly unsigned int sysctl_sched_window_stats_policy =
+ WINDOW_STATS_USE_AVG;
+
+static __read_mostly unsigned int sched_account_wait_time = 1;
+__read_mostly unsigned int sysctl_sched_account_wait_time = 1;
+
/* Window size (in ns) */
__read_mostly unsigned int sched_ravg_window = 10000000;
@@ -1182,18 +1192,6 @@ __read_mostly unsigned int sched_ravg_window = 10000000;
/* Max window size (in ns) = 1s */
#define MAX_SCHED_RAVG_WINDOW 1000000000
-__read_mostly unsigned int sysctl_sched_window_stats_policy =
- WINDOW_STATS_USE_AVG;
-
-/*
- * copy of sysctl_sched_window_stats_policy. Required for atomically
- * changing policy (see sched_window_stats_policy_update_handler() for details).
- *
- * Initialize both to same value!!
- */
-static __read_mostly unsigned int sched_window_stats_policy =
- WINDOW_STATS_USE_AVG;
-
/* 1 -> use PELT based load stats, 0 -> use window-based load stats */
unsigned int __read_mostly sched_use_pelt;
@@ -1203,13 +1201,6 @@ unsigned int min_possible_efficiency = 1024;
__read_mostly int sysctl_sched_freq_inc_notify_slack_pct = -INT_MAX;
__read_mostly int sysctl_sched_freq_dec_notify_slack_pct = INT_MAX;
-static __read_mostly unsigned int sched_account_wait_time = 1;
-/*
- * Copy of sched_account_wait_time, used to change it atomically.
- * Initialize both variables to same value!!
- */
-__read_mostly unsigned int sysctl_sched_account_wait_time = 1;
-
static __read_mostly unsigned int sched_io_is_busy;
/*