]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix division by zero - really
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 27 Aug 2009 11:08:56 +0000 (13:08 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 28 Aug 2009 06:26:49 +0000 (08:26 +0200)
commitcefaa5c96fd312aa31d8d049685b2eb85bf81b90
treea2c6551f169b1a7e27191098fa8e6acf7f2a76cd
parentbede8215d0453b6867da53045b206a7504567d3d
sched: Fix division by zero - really

When re-computing the shares for each task group's cpu
representation we need the ratio of weight on each cpu vs the
total weight of the sched domain.

Since load-balancing is loosely (read not) synchronized, the
weight of individual cpus can change between doing the sum and
calculating the ratio.

The previous patch dealt with only one of the race scenarios,
this patch side steps them all by saving a snapshot of all the
individual cpu weights, thereby always working on a consistent
set.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: torvalds@linux-foundation.org
Cc: jes@sgi.com
Cc: jens.axboe@oracle.com
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <1251371336.18584.77.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c