sched: Avoid division by zero
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 21 Aug 2009 11:58:54 +0000 (13:58 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 21 Aug 2009 12:15:10 +0000 (14:15 +0200)
commita8af7246c114bfd939e539f9566b872c06f6225c
treed624ea07739b92d3ff1a676a3244fd7188d8198f
parentcde7e5ca4e329a157108769d1f752d191cbb71c6
sched: Avoid division by zero

Patch a5004278f0525dcb9aa43703ef77bf371ea837cd (sched: Fix
cgroup smp fairness) introduced the possibility of a
divide-by-zero because load-balancing is not synchronized
between sched_domains.

This can cause the state of cpus to change between the first
and second loop over the sched domain in tg_shares_up().

Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jes Sorensen <jes@sgi.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <1250855934.7538.30.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c