diff options
author | Srivatsa Vaddagiri <vatsa@codeaurora.org> | 2014-08-06 15:29:58 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:00:16 -0700 |
commit | 13b29fc0f7a21a1c854f104f1a7a421342786a6b (patch) | |
tree | bbc056305692d9a3cf9c704e380d81fe5ff25962 | |
parent | 4641b37da8e5f2ee3440a0ca488541ec856c18db (diff) |
sched: window-stats: 64-bit type for curr/prev_runnable_sum
Expand rq->curr_runnable_sum and rq->prev_runnable_sum to be 64-bit
counters as otherwise they can easily overflow when a cpu has many
tasks.
Change-Id: I68ab2658ac6a3174ddb395888ecd6bf70ca70473
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
-rw-r--r-- | kernel/sched/core.c | 8 | ||||
-rw-r--r-- | kernel/sched/sched.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2d08b9e505a0..4946d5acebca 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1335,7 +1335,7 @@ compute_demand: if (update_sum && (p->ravg.flags & CURR_WINDOW_CONTRIB)) { rq->curr_runnable_sum -= p->ravg.partial_demand; - BUG_ON((int)rq->curr_runnable_sum < 0); + BUG_ON((s64)rq->curr_runnable_sum < 0); } p->ravg.partial_demand = demand; @@ -1544,7 +1544,7 @@ static void update_task_ravg(struct task_struct *p, struct rq *rq, } else { if (!nr_full_windows) { rq->prev_runnable_sum -= partial_demand; - BUG_ON(rq->prev_runnable_sum < 0); + BUG_ON((s64)rq->prev_runnable_sum < 0); } rq->prev_runnable_sum += p->ravg.demand; rq->curr_runnable_sum += p->ravg.partial_demand; @@ -2032,8 +2032,8 @@ static void fixup_busy_time(struct task_struct *p, int new_cpu) dest_rq->prev_runnable_sum += p->ravg.demand; } - BUG_ON((int)src_rq->prev_runnable_sum < 0); - BUG_ON((int)src_rq->curr_runnable_sum < 0); + BUG_ON((s64)src_rq->prev_runnable_sum < 0); + BUG_ON((s64)src_rq->curr_runnable_sum < 0); trace_sched_migration_update_sum(src_rq); trace_sched_migration_update_sum(dest_rq); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index f1fa00c2448c..1d5a78d7a038 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -659,8 +659,8 @@ struct rq { int max_possible_capacity; u64 window_start; - unsigned int curr_runnable_sum; - unsigned int prev_runnable_sum; + u64 curr_runnable_sum; + u64 prev_runnable_sum; #endif #ifdef CONFIG_SCHED_HMP |