Re: divide by zero bug in find_busiest_group

From: Peter Zijlstra
Date: Fri Aug 27 2010 - 03:51:59 EST


On Thu, 2010-08-26 at 16:52 -0700, Chetan Ahuja wrote:
> For one thing, I don't understand the reason for recomputing
> cpu_power dynamically. How does cpu_power of a gorup (which I believe
> refers to the group of "hyper-threaded" cores on one physical core)
> change while inthe system is in operation ? Is this in support of
> hot-swappable CPU's or something ?

No the groups are used for increasingly larger accumulations of cpus,
the first group is the singleton group which contains on the one cpu in
question, after that we start following the machine topology,
hyper-threads, multi-core, package, node etc. until the last group spans
the whole machine.

The dynamic cpu_power computation comes from RT tasks, when we
load-balance SCHED_OTHER tasks, we want each cpu to have an equal amount
of pending work, however when one CPU is say 50% busy with RT tasks (and
hopefully soon IRQ load), it cannot perform the same amount of work as
another unloaded cpu, therefore we need to normalize the relative load
levels between cpu. We use cpu_power as this load normalization factor.

Load balancing works by balancing this group hierarchy, a number of
groups are contained in a domain. Each cpu does a load-balance pull,
from the busiest group in that domain to his local domain. Since there's
ever smaller groups/domains you eventually end up with a nicely spread
load.

> To be honest, for my use case, I'd like to just disable the whole
> work-stealing stuff (referred to as load-balancing in the kernel).
> There seems to be no config option that isolates just the dynamic
> load-balancing parts (or is there ?) so maybe I'd just hack away the
> load-balancing functions by hand so as never to worry about those
> denominators again.

You can do that at runtime, read: Documentation/cgroups/cpusets.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/