summaryrefslogtreecommitdiff
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorJoonwoo Park <joonwoop@codeaurora.org>2014-12-16 10:20:40 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:01:22 -0700
commit790d5d8a4ad4309dfc44ca217fe073b1e51200c1 (patch)
treef93ae6161fa3737e9a3baa861c32cc55e1da7924 /kernel/sysctl.c
parent90dc3fa9a78bc47e995772172cce0089b6f17ec1 (diff)
sched: Prevent race conditions where upmigrate_min_nice changes
When upmigrate_min_nice is changed dec_nr_big_small_task() can trigger BUG_ON(rq->nr_big_tasks < 0). This happens when there is a task which was considered as non-big task due to its nice > upmigrate_min_nice and later upmigrate_min_nice is changed to higher value so the task becomes big task. In this case runqueue still has nr_big_tasks = 0 incorrectly with current implementation. Consequently next scheduler tick sees a big task to schedule and try to decrease nr_big_tasks which is already 0. Introduce sched_upmigrate_min_nice which is updated atomically and re-count the number of big and small tasks to fix BUG_ON() triggering. Change-Id: I6f5fc62ed22bbe5c52ec71613082a6e64f406e58 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 5e171b035482..69a379c4573f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -412,7 +412,7 @@ static struct ctl_table kern_table[] = {
.data = &sysctl_sched_upmigrate_min_nice,
.maxlen = sizeof(unsigned int),
.mode = 0644,
- .proc_handler = proc_dointvec,
+ .proc_handler = sched_hmp_proc_update_handler,
},
{
.procname = "sched_prefer_idle",