summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorOlav Haugan <ohaugan@codeaurora.org>2014-08-07 18:24:21 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:00:19 -0700
commit8eede4a8d50a1d4e7203a4bbaa3209ddf346c985 (patch)
tree89ab46834e4014d61a28f2d75efebc5e435563a4 /include/linux
parent778ce1a13c3f199fc44c53078fc2419075b9a0b8 (diff)
sched: Make RAVG_HIST_SIZE tunable
Make RAVG_HIST_SIZE available from /proc/sys/kernel/sched_ravg_hist_size to allow tuning of the size of the history that is used in computation of task demand. CRs-fixed: 706138 Change-Id: Id54c1e4b6e974a62d787070a0af1b4e8ce3b4be6 Signed-off-by: Olav Haugan <ohaugan@codeaurora.org> [joonwoop@codeaurora.org: fixed minor conflict in sysctl.h] Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h9
-rw-r--r--include/linux/sched/sysctl.h4
2 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 67b849a7df2c..f582c99d624f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1253,7 +1253,7 @@ struct sched_statistics {
};
#endif
-#define RAVG_HIST_SIZE 5
+#define RAVG_HIST_SIZE_MAX 5
/* ravg represents frequency scaled cpu-demand of tasks */
struct ravg {
@@ -1269,8 +1269,9 @@ struct ravg {
* RAVG_HIST_SIZE windows. Windows where task was entirely sleeping are
* ignored.
*
- * 'demand' represents maximum sum seen over previous RAVG_HIST_SIZE
- * windows. 'demand' could drive frequency demand for tasks.
+ * 'demand' represents maximum sum seen over previous
+ * sysctl_sched_ravg_hist_size windows. 'demand' could drive frequency
+ * demand for tasks.
*
* 'prev_window' is the history in the most recent window. This value
* may be zero if there was no task activity in that window - that is
@@ -1282,7 +1283,7 @@ struct ravg {
*/
u64 mark_start;
u32 sum, demand, prev_window, partial_demand, flags;
- u32 sum_history[RAVG_HIST_SIZE];
+ u32 sum_history[RAVG_HIST_SIZE_MAX];
};
struct sched_entity {
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index 47dd5253fd94..de111f548637 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -43,6 +43,7 @@ extern unsigned int sysctl_sched_wake_to_idle;
extern unsigned int sysctl_sched_wakeup_load_threshold;
extern unsigned int sysctl_sched_window_stats_policy;
extern unsigned int sysctl_sched_account_wait_time;
+extern unsigned int sysctl_sched_ravg_hist_size;
#if defined(CONFIG_SCHED_FREQ_INPUT) || defined(CONFIG_SCHED_HMP)
extern unsigned int sysctl_sched_init_task_load_pct;
@@ -110,6 +111,9 @@ extern int sched_acct_wait_time_update_handler(struct ctl_table *table,
extern int sched_window_stats_policy_update_handler(struct ctl_table *table,
int write, void __user *buffer, size_t *lenp, loff_t *ppos);
+extern int sched_ravg_hist_size_update_handler(struct ctl_table *table,
+ int write, void __user *buffer, size_t *lenp, loff_t *ppos);
+
/*
* control realtime throttling:
*