[PATCH] sched: CPU_THRESHOLD

Frank Cornelis
2003-08-22T12:53:48Z

Hi,

Next patch provides a CPU_THRESHOLD; makes sense since we also have a NODE_THRESHOLD as tuning knob.

Frank.

sched.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff -Nru a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c Fri Aug 22 14:20:23 2003
+++ b/kernel/sched.c Fri Aug 22 14:20:23 2003
@@ -76,6 +76,7 @@
#define MAX_SLEEP_AVG (10*HZ)
#define STARVATION_LIMIT (10*HZ)
#define NODE_THRESHOLD 125
+#define CPU_THRESHOLD 75

/*
* If a task is 'interactive' then we reinsert it in the active
@@ -963,10 +964,9 @@
if (likely(!busiest))
goto out;

- *imbalance = (max_load - nr_running) / 2;
+ *imbalance = (max_load - nr_running) >> 1;

- /* It needs an at least ~25% imbalance to trigger balancing. */
- if (!idle && (*imbalance < (max_load + 3)/4)) {
+ if (!idle && (*imbalance*100 < nr_running*CPU_THRESHOLD)) {
busiest = NULL;
goto out;
}