[PATCH v2] cpuset sched_load_balance flag

Previous thread: [PATCH] ftdi_sio: fix FT232RL support for TIOCMGET by Bernardo Innocenti on Saturday, October 6, 2007 - 12:07 am. (2 messages)

Next thread: [PATCH] cpusets - decrustify cpuset mask update code by Paul Jackson on Saturday, October 6, 2007 - 2:47 am. (2 messages)
From: Paul Jackson
Date: Saturday, October 6, 2007 - 2:47 am

From: Paul Jackson <pj@sgi.com>

Add a new per-cpuset flag called 'sched_load_balance'.

When enabled in a cpuset (the default value) it tells the kernel
scheduler that the scheduler should provide the normal load
balancing on the CPUs in that cpuset, sometimes moving tasks
from one CPU to a second CPU if the second CPU is less loaded
and if that task is allowed to run there.

When disabled (write "0" to the file) then it tells the kernel
scheduler that load balancing is not required for the CPUs in
that cpuset.

Now even if this flag is disabled for some cpuset, the kernel
may still have to load balance some or all the CPUs in that
cpuset, if some overlapping cpuset has its sched_load_balance
flag enabled.

If there are some CPUs that are not in any cpuset whose
sched_load_balance flag is enabled, the kernel scheduler will
not load balance tasks to those CPUs.

Moreover the kernel will partition the 'sched domains'
(non-overlapping sets of CPUs over which load balancing is
attempted) into the finest granularity partition that it can
find, while still keeping any two CPUs that are in the same
shed_load_balance enabled cpuset in the same element of the
partition.

This serves two purposes:
 1) It provides a mechanism for real time isolation of some CPUs, and
 2) it can be used to improve performance on systems with many CPUs
    by supporting configurations in which load balancing is not done
    across all CPUs at once, but rather only done in several smaller
    disjoint sets of CPUs.

This mechanism replaces the earlier overloading of the per-cpuset
flag 'cpu_exclusive', which overloading was removed in an earlier
patch: cpuset-remove-sched-domain-hooks-from-cpusets

See further the Documentation and comments in the code itself.

Signed-off-by: Paul Jackson <pj@sgi.com>

---

Andrew - this patch goes right after your *-mm patch:
  task-containers-enable-containers-by-default-in-some-configs.patch

 Documentation/cpusets.txt |  141 ++++++++++++++++++++++++-
 ...
From: Ingo Molnar
Date: Saturday, October 6, 2007 - 4:17 am

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo
-

From: Andrew Morton
Date: Wednesday, October 10, 2007 - 7:29 pm

We generally only excuse failure to check kmalloc return value when the

Ditto


I't s a fairly minor thing really, but children might be watching..
-

From: Paul Jackson
Date: Wednesday, October 10, 2007 - 8:10 pm

Ah - good catch - thanks, Andrew.  I should put together a fix,
to check these kmalloc calls.

For rebuild_sched_domains(), this can mean we just up and return having
done nothing.

For arch_init_sched_domains(), the code calling arch_init_sched_domains()
is not checking for failure, and doesn't have a trivial fallback code
path in the case of failure.  I'll have to think about that one just a
little.

Thanks, Andrew!

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401
-

Previous thread: [PATCH] ftdi_sio: fix FT232RL support for TIOCMGET by Bernardo Innocenti on Saturday, October 6, 2007 - 12:07 am. (2 messages)

Next thread: [PATCH] cpusets - decrustify cpuset mask update code by Paul Jackson on Saturday, October 6, 2007 - 2:47 am. (2 messages)