mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: smpnice - fix average load per run queue calculations
@ 2006-02-27  6:30 Peter Williams
  2006-02-27  6:56 ` Peter Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Williams @ 2006-02-27  6:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linux Kernel Mailing List, Con Kolivas, Ingo Molnar, npiggin,
	Siddha, Suresh B, Chen, Kenneth W, John Hawkes

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

The logical value to use for the average load per task on a run queue 
without any runnable tasks is the "default" load for a nice==0 task. 
Failure to do this may lead to anomalies in try_to_wake_up(), etc.

Signed-off-by: Peter Williams <pwil3058@bigpond.com.au>

Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

[-- Attachment #2: fix-avg-load-per-rq --]
[-- Type: text/plain, Size: 499 bytes --]

Index: MM-2.6.X/kernel/sched.c
===================================================================
--- MM-2.6.X.orig/kernel/sched.c	2006-02-27 17:18:12.000000000 +1100
+++ MM-2.6.X/kernel/sched.c	2006-02-27 17:19:52.000000000 +1100
@@ -1058,7 +1058,7 @@ static inline unsigned long cpu_avg_load
 	runqueue_t *rq = cpu_rq(cpu);
 	unsigned long n = rq->nr_running;
 
-	return n ?  rq->raw_weighted_load / n : rq->raw_weighted_load;
+	return n ?  rq->raw_weighted_load / n : SCHED_LOAD_SCALE;
 }
 
 /*

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched: smpnice - fix average load per run queue calculations
  2006-02-27  6:30 [PATCH] sched: smpnice - fix average load per run queue calculations Peter Williams
@ 2006-02-27  6:56 ` Peter Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Williams @ 2006-02-27  6:56 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linux Kernel Mailing List, Con Kolivas, Ingo Molnar, npiggin,
	Siddha, Suresh B, Chen, Kenneth W, John Hawkes

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

Peter Williams wrote:
> The logical value to use for the average load per task on a run queue 
> without any runnable tasks is the "default" load for a nice==0 task. 
> Failure to do this may lead to anomalies in try_to_wake_up(), etc.
> 
> Signed-off-by: Peter Williams <pwil3058@bigpond.com.au>

I missed a bit.  Here's a fixed patch.

Signed-off-by: Peter Williams <pwil3058@bigpond.com.au>

Sorry,
Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

[-- Attachment #2: fix-avg-load-per-rq --]
[-- Type: text/plain, Size: 826 bytes --]

Index: MM-2.6.X/kernel/sched.c
===================================================================
--- MM-2.6.X.orig/kernel/sched.c	2006-02-27 17:18:12.000000000 +1100
+++ MM-2.6.X/kernel/sched.c	2006-02-27 17:53:49.000000000 +1100
@@ -1058,7 +1058,7 @@ static inline unsigned long cpu_avg_load
 	runqueue_t *rq = cpu_rq(cpu);
 	unsigned long n = rq->nr_running;
 
-	return n ?  rq->raw_weighted_load / n : rq->raw_weighted_load;
+	return n ?  rq->raw_weighted_load / n : SCHED_LOAD_SCALE;
 }
 
 /*
@@ -2153,6 +2153,8 @@ find_busiest_group(struct sched_domain *
 			min(busiest_load_per_task, max_load);
 		if (this_nr_running)
 			this_load_per_task /= this_nr_running;
+		else
+			this_load_per_task = SCHED_LOAD_SCALE;
 		pwr_now += this->cpu_power *
 			min(this_load_per_task, this_load);
 		pwr_now /= SCHED_LOAD_SCALE;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-27  6:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-27  6:30 [PATCH] sched: smpnice - fix average load per run queue calculations Peter Williams
2006-02-27  6:56 ` Peter Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®