From owner-cvs-src@FreeBSD.ORG  Sun Nov 12 06:26:12 2006
Return-Path: <owner-cvs-src@FreeBSD.ORG>
X-Original-To: cvs-src@FreeBSD.org
Delivered-To: cvs-src@FreeBSD.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A994416A40F;
	Sun, 12 Nov 2006 06:26:12 +0000 (UTC) (envelope-from bde@zeta.org.au)
Received: from mailout2.pacific.net.au (mailout2-3.pacific.net.au [61.8.2.226])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 542E043D55;
	Sun, 12 Nov 2006 06:26:12 +0000 (GMT) (envelope-from bde@zeta.org.au)
Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au
	[61.8.2.162])
	by mailout2.pacific.net.au (Postfix) with ESMTP id 1B5213092E7;
	Sun, 12 Nov 2006 17:26:10 +1100 (EST)
Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246])
	by mailproxy1.pacific.net.au (Postfix) with ESMTP id 710EB8C12;
	Sun, 12 Nov 2006 17:26:09 +1100 (EST)
Date: Sun, 12 Nov 2006 17:26:08 +1100 (EST)
From: Bruce Evans <bde@zeta.org.au>
X-X-Sender: bde@delplex.bde.org
To: David Xu <davidxu@FreeBSD.org>
In-Reply-To: <200611120716.10773.davidxu@freebsd.org>
Message-ID: <20061112170556.U71828@delplex.bde.org>
References: <200611111311.kABDBVNH042993@repoman.freebsd.org>
	<20061112031308.I69769@delplex.bde.org>
	<200611120716.10773.davidxu@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject: Re: cvs commit: src/sys/kern sched_4bsd.c
X-BeenThere: cvs-src@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit messages for the src tree <cvs-src.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-src>
List-Post: <mailto:cvs-src@freebsd.org>
List-Help: <mailto:cvs-src-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Nov 2006 06:26:12 -0000

On Sun, 12 Nov 2006, David Xu wrote:

> On Sunday 12 November 2006 00:22, Bruce Evans wrote:
>> On Sat, 11 Nov 2006, David Xu wrote:
>>> davidxu     2006-11-11 13:11:30 UTC
>>>
>>>  FreeBSD src repository
>>>
>>>  Modified files:
>>>    sys/kern             sched_4bsd.c
>>>  Log:
>>>  Unbreak userland priority inheriting in NO_KSE case.
>>
>> Is this what made the non-KSE case unusable?  At least with the load
>> average bug fixed, it gave very unfair scheduling, and would only start
>> about 4 concurrent hog processes on a 2-way SMP system.
>>
>> Improvements in some benchmarks may have depended on the bugs.  Maybe
>> a random load average is optimal for some loads :-).
>
> No, this change is unrelated, the bug is in kern_idle.c, John should use
> mi_switch(), not the choosethread(), otherwise the loadavg is not
> maintianed correctly.

That's not the bug I meant.  I already had your fix for kern_idle.c.

Testing showed that nothing much is fixed.  Simple benchmarks like:

%%%
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
     nice -$i sh -c "while :; do echo -n;done" &
done
top -o time
%%%

and

%%%
for i in 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
do
     nice -$i sh -c "while :; do echo -n;done" &
done
top -o time
%%%

still show that scheduling without KSE is very unfair.  They can take
several minutes to start the `top' process, and "killall sh" can take
many seconds to start unless you have an rtprio shell to start the
killall.

With KSE, the top process starts soon enough and shows just the old
4BSD scheduler bug that too many cycles are given to niced programs,
as in all versions of FreeBSD except 4.x.  Since no one uses niced
programs, this bug is unimportant.

Bruce