Skip to contentSkip to conversation

(3/3) NUMA rebalancer

PATCH New Martin J. Bligh 1 participant 1 message Jan 16, 2003 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (3/3) NUMA rebalancer

Patch from Erich Focht

This adds a hook to rebalance globally across nodes every NODE_BALANCE_RATE iterations of the rebalancer. This allows us to easily tune on an architecture specific basis how often we wish to rebalance - machines with higher NUMA ratios (more expensive off-node access) will want to do this less often. It's currently set to 100 for NUMA-Q and 10 for other machines. If the imbalance between nodes is > 125%, we'll rebalance them. The hook for this is added to the NUMA definition of cpus_to_balance, so again, no impact on non-NUMA machines.

include/asm-generic/topology.h +5 -0
diff -urpN -X /home/fletch/.diff.exclude numasched2/include/asm-generic/topology.h numasched3/include/asm-generic/topology.h
@@ -48,4 +48,9 @@
 #define __node_to_memblk(node)		(0)
 #endif
 
+/* Cross-node load balancing interval. */
+#ifndef NODE_BALANCE_RATE
+#define NODE_BALANCE_RATE 10
+#endif
+
 #endif /* _ASM_GENERIC_TOPOLOGY_H */
include/asm-i386/topology.h +3 -0
diff -urpN -X /home/fletch/.diff.exclude numasched2/include/asm-i386/topology.h numasched3/include/asm-i386/topology.h
@@ -61,6 +61,9 @@ static inline int __node_to_first_cpu(in
 /* Returns the number of the first MemBlk on Node 'node' */
 #define __node_to_memblk(node) (node)
 
+/* Cross-node load balancing interval. */
+#define NODE_BALANCE_RATE 100
+
 #else /* !CONFIG_NUMA */
 /*
  * Other i386 platforms should define their own version of the 
include/asm-ia64/topology.h +3 -0
diff -urpN -X /home/fletch/.diff.exclude numasched2/include/asm-ia64/topology.h numasched3/include/asm-ia64/topology.h
@@ -60,4 +60,7 @@
  */
 #define __node_to_memblk(node) (node)
 
+/* Cross-node load balancing interval. */
+#define NODE_BALANCE_RATE 10
+
 #endif /* _ASM_IA64_TOPOLOGY_H */
include/asm-ppc64/topology.h +3 -0
diff -urpN -X /home/fletch/.diff.exclude numasched2/include/asm-ppc64/topology.h numasched3/include/asm-ppc64/topology.h
@@ -46,6 +46,9 @@ static inline unsigned long __node_to_cp
 	return mask;
 }
 
+/* Cross-node load balancing interval. */
+#define NODE_BALANCE_RATE 10
+
 #else /* !CONFIG_NUMA */
 
 #define __cpu_to_node(cpu)		(0)
kernel/sched.c +45 -4

78 lines not on this page · raw message