linux/arch
John Hawkes f68f447e83 [PATCH] ia64 cpuset + build_sched_domains() mangles structures
I've already sent this to the maintainers, and this is now being sent to a
larger community audience.  I have fixed a problem with the ia64 version of
build_sched_domains(), but a similar fix still needs to be made to the
generic build_sched_domains() in kernel/sched.c.

The "dynamic sched domains" functionality has recently been merged into
2.6.13-rcN that sees the dynamic declaration of a cpu-exclusive (a.k.a.
"isolated") cpuset and rebuilds the CPU Scheduler sched domains and sched
groups to separate away the CPUs in this cpu-exclusive cpuset from the
remainder of the non-isolated CPUs.  This allows the non-isolated CPUs to
completely ignore the isolated CPUs when doing load-balancing.

Unfortunately, build_sched_domains() expects that a sched domain will
include all the CPUs of each node in the domain, i.e., that no node will
belong in both an isolated cpuset and a non-isolated cpuset.  Declaring a
cpuset that violates this presumption will produce flawed data structures
and will oops the kernel.

To trigger the problem (on a NUMA system with >1 CPUs per node):
   cd /dev/cpuset
   mkdir newcpuset
   cd newcpuset
   echo 0 >cpus
   echo 0 >mems
   echo 1 >cpu_exclusive

I have fixed this shortcoming for ia64 NUMA (with multiple CPUs per node).
A similar shortcoming exists in the generic build_sched_domains() (in
kernel/sched.c) for NUMA, and that needs to be fixed also.  The fix
involves dynamically allocating sched_group_nodes[] and
sched_group_allnodes[] for each invocation of build_sched_domains(), rather
than using global arrays for these structures.  Care must be taken to
remember kmalloc() addresses so that arch_destroy_sched_domains() can
properly kfree() the new dynamic structures.

Signed-off-by: John Hawkes <hawkes@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07 16:57:39 -07:00
..
alpha [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
arm [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
arm26 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
cris [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
frv [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
h8300 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
i386 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
ia64 [PATCH] ia64 cpuset + build_sched_domains() mangles structures 2005-09-07 16:57:39 -07:00
m32r [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
m68k [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
m68knommu [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
mips [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
parisc [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
ppc [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
ppc64 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
s390 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
sh [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
sh64 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
sparc [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
sparc64 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
um [PATCH] remove verify_area(): remove verify_area() from various uaccess.h headers 2005-09-07 16:57:35 -07:00
v850 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
x86_64 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
xtensa [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00