Skip to contentSkip to conversation

sched: CPU_THRESHOLD

PATCH New Frank Cornelis 1 participant 1 message Aug 22, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: CPU_THRESHOLD

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(-)
kernel/sched.c +3 -3
diff -Nru a/kernel/sched.c b/kernel/sched.c
@@ -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;
 	}