aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2005-06-25 17:57:13 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:24:41 -0400
commit7897986bad8f6cd50d6149345aca7f6480f49464 (patch)
tree10a5e08e004ae685aaab6823a3774803455b7704 /include
parent99b61ccf0bf0e9a85823d39a5db6a1519caeb13d (diff)
[PATCH] sched: balance timers
Do CPU load averaging over a number of different intervals. Allow each interval to be chosen by sending a parameter to source_load and target_load. 0 is instantaneous, idx > 0 returns a decaying average with the most recent sample weighted at 2^(idx-1). To a maximum of 3 (could be easily increased). So generally a higher number will result in more conservative balancing. Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/topology.h4
-rw-r--r--include/asm-x86_64/topology.h6
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/topology.h8
4 files changed, 21 insertions, 1 deletions
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 6d0f67507b21..0055fbfeec7b 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -74,6 +74,10 @@ static inline int node_to_first_cpu(int node)
74 .imbalance_pct = 125, \ 74 .imbalance_pct = 125, \
75 .cache_hot_time = (10*1000000), \ 75 .cache_hot_time = (10*1000000), \
76 .cache_nice_tries = 1, \ 76 .cache_nice_tries = 1, \
77 .busy_idx = 3, \
78 .idle_idx = 1, \
79 .newidle_idx = 2, \
80 .wake_idx = 1, \
77 .per_cpu_gain = 100, \ 81 .per_cpu_gain = 100, \
78 .flags = SD_LOAD_BALANCE \ 82 .flags = SD_LOAD_BALANCE \
79 | SD_BALANCE_EXEC \ 83 | SD_BALANCE_EXEC \
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 8f77e9f6bc23..fe8d80a15751 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -39,7 +39,11 @@ extern int __node_distance(int, int);
39 .busy_factor = 32, \ 39 .busy_factor = 32, \
40 .imbalance_pct = 125, \ 40 .imbalance_pct = 125, \
41 .cache_hot_time = (10*1000000), \ 41 .cache_hot_time = (10*1000000), \
42 .cache_nice_tries = 1, \ 42 .cache_nice_tries = 2, \
43 .busy_idx = 3, \
44 .idle_idx = 2, \
45 .newidle_idx = 1, \
46 .wake_idx = 1, \
43 .per_cpu_gain = 100, \ 47 .per_cpu_gain = 100, \
44 .flags = SD_LOAD_BALANCE \ 48 .flags = SD_LOAD_BALANCE \
45 | SD_BALANCE_NEWIDLE \ 49 | SD_BALANCE_NEWIDLE \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2c69682b0444..664981ac1fb6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -488,6 +488,10 @@ struct sched_domain {
488 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ 488 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
489 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ 489 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */
490 unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ 490 unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */
491 unsigned int busy_idx;
492 unsigned int idle_idx;
493 unsigned int newidle_idx;
494 unsigned int wake_idx;
491 int flags; /* See SD_* */ 495 int flags; /* See SD_* */
492 496
493 /* Runtime fields. */ 497 /* Runtime fields. */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index d70e8972c67f..ae9c2216dfa6 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -89,6 +89,10 @@
89 .cache_hot_time = 0, \ 89 .cache_hot_time = 0, \
90 .cache_nice_tries = 0, \ 90 .cache_nice_tries = 0, \
91 .per_cpu_gain = 25, \ 91 .per_cpu_gain = 25, \
92 .busy_idx = 0, \
93 .idle_idx = 0, \
94 .newidle_idx = 0, \
95 .wake_idx = 0, \
92 .flags = SD_LOAD_BALANCE \ 96 .flags = SD_LOAD_BALANCE \
93 | SD_BALANCE_NEWIDLE \ 97 | SD_BALANCE_NEWIDLE \
94 | SD_BALANCE_EXEC \ 98 | SD_BALANCE_EXEC \
@@ -115,6 +119,10 @@
115 .cache_hot_time = (5*1000000/2), \ 119 .cache_hot_time = (5*1000000/2), \
116 .cache_nice_tries = 1, \ 120 .cache_nice_tries = 1, \
117 .per_cpu_gain = 100, \ 121 .per_cpu_gain = 100, \
122 .busy_idx = 2, \
123 .idle_idx = 0, \
124 .newidle_idx = 1, \
125 .wake_idx = 1, \
118 .flags = SD_LOAD_BALANCE \ 126 .flags = SD_LOAD_BALANCE \
119 | SD_BALANCE_NEWIDLE \ 127 | SD_BALANCE_NEWIDLE \
120 | SD_BALANCE_EXEC \ 128 | SD_BALANCE_EXEC \