summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@codeaurora.org>2014-07-23 14:27:18 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:00:03 -0700
commit1ffae4dc94bded073868b760fafa443a44303f55 (patch)
tree907ea9e3c6144c020938b04e0ddeb80f08b90308 /include/linux
parent0b210afc21c31a1bd28b721a70a54aced29eedb0 (diff)
sched: window-stats: Handle policy change properly
sched_window_stat_policy influences task demand and thus various statistics maintained per-cpu like curr_runnable_sum. Changing policy non-atomically would lead to improper accounting. For example, when task is enqueued on a cpu's runqueue, its demand that is added to rq->cumulative_runnable_avg could be based on AVG policy and when its dequeued its demand that is removed can be based on MAX, leading to erroneous accounting. This change causes policy change to be "atomic" i.e all cpu's rq->lock are held and all task's window-stats are reset before policy is changed. Change-Id: I6a3e4fb7bc299dfc5c367693b5717a1ef518c32d CRs-Fixed: 687409 Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org> [joonwoop@codeaurora.org: fixed minor conflict in include/linux/sched/sysctl.h. Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched/sysctl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index da06dc1a374b..d3dab9c4c4c8 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -103,6 +103,9 @@ extern int sched_hmp_proc_update_handler(struct ctl_table *table,
extern int sched_boost_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
+extern int sched_window_stats_policy_update_handler(struct ctl_table *table,
+ int write, void __user *buffer, size_t *lenp, loff_t *ppos);
+
/*
* control realtime throttling:
*