summaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-bit.c
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2016-09-28 12:21:03 +0530
committerPavankumar Kondeti <pkondeti@codeaurora.org>2016-10-04 08:47:48 +0530
commitf20772adf3d0ce00c6100f462ed12e05b805edd8 (patch)
tree8e684d431dbe1d0019c5f5717c8f94b2133a2c46 /lib/mpi/mpi-bit.c
parent057bdafd976ca7609ed223dbd4473d535bcb6459 (diff)
sched: Fix integer overflow in sched_update_nr_prod()
"int" type is used to hold the time difference between the successive updates to nr_run in sched_update_nr_prod(). This can result in overflow, if the function is called ~2.15 sec after it was called before. The most probable scenarios are when CPU is idle and hotplugged. But as we update the last_time of all possible CPUs in sched_get_nr_running_avg() periodically from a deferrable timer context (core_ctl module), this overflow is observed only when the system is completely idle for long time. When this overflow happens we hit a BUG_ON() in sched_get_nr_running_avg(). Use "u64" type instead of "int" for holding the time difference and add additional BUG_ON() to catch the instances where sched_clock() returns a backward value. Change-Id: I284abb5889ceb8cf9cc689c79ed69422a0e74986 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions