]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix odd values in effective_load() calculations
authorYuyang Du <yuyang.du@intel.com>
Fri, 19 Dec 2014 00:29:56 +0000 (08:29 +0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 9 Jan 2015 10:18:54 +0000 (11:18 +0100)
commit869b8fe205c5ec56fbd0bdd88a2a10fbc829fd50
tree53e679c64d49f4a7dd1b23644c89517a391f7d33
parent14edcbce3f02cb91b558b04963e7885bc9b8e729
sched: Fix odd values in effective_load() calculations

In effective_load, we have (long w * unsigned long tg->shares) / long W,
when w is negative, it is cast to unsigned long and hence the product is
insanely large. Fix this by casting tg->shares to long.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Yuyang Du <yuyang.du@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Dave Jones <davej@redhat.com>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20141219002956.GA25405@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c