From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbWB0G4Q (ORCPT ); Mon, 27 Feb 2006 01:56:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751625AbWB0G4Q (ORCPT ); Mon, 27 Feb 2006 01:56:16 -0500 Received: from omta02sl.mx.bigpond.com ([144.140.93.154]:13949 "EHLO omta02sl.mx.bigpond.com") by vger.kernel.org with ESMTP id S1751615AbWB0G4P (ORCPT ); Mon, 27 Feb 2006 01:56:15 -0500 Message-ID: <4402A28C.9090008@bigpond.net.au> Date: Mon, 27 Feb 2006 17:56:12 +1100 From: Peter Williams User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton CC: Linux Kernel Mailing List , Con Kolivas , Ingo Molnar , npiggin@suse.de, "Siddha, Suresh B" , "Chen, Kenneth W" , John Hawkes Subject: Re: [PATCH] sched: smpnice - fix average load per run queue calculations References: <44029C9B.10507@bigpond.net.au> In-Reply-To: <44029C9B.10507@bigpond.net.au> Content-Type: multipart/mixed; boundary="------------070007030304060702080400" X-Authentication-Info: Submitted using SMTP AUTH PLAIN at omta02sl.mx.bigpond.com from [147.10.133.38] using ID pwil3058@bigpond.net.au at Mon, 27 Feb 2006 06:56:13 +0000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------070007030304060702080400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 I missed a bit. Here's a fixed patch. Signed-off-by: Peter Williams Sorry, Peter -- Peter Williams pwil3058@bigpond.net.au "Learning, n. The kind of ignorance distinguishing the studious." -- Ambrose Bierce --------------070007030304060702080400 Content-Type: text/plain; name="fix-avg-load-per-rq" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix-avg-load-per-rq" 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; --------------070007030304060702080400--