From owner-freebsd-current Fri Jun 9 17:29: 2 2000 Delivered-To: freebsd-current@freebsd.org Received: from localhost (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 5192F37B61B; Fri, 9 Jun 2000 17:28:24 -0700 (PDT) (envelope-from green@FreeBSD.org) Date: Fri, 9 Jun 2000 20:28:06 -0400 (EDT) From: Brian Fundakowski Feldman X-Sender: green@green.dyndns.org To: "Jacob A. Hart" Cc: Doug Barton , Sheldon Hearn , FreeBSD-CURRENT Subject: Re: Scheduler changes? In-Reply-To: <20000528135331.A241@carcass.au.hartware.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 28 May 2000, Jacob A. Hart wrote: > I remember the scheduler bug you're talking about. My system feels much > the same as it did during 4.0-CURRENT when that bug was active. I had a > collection of wrapper scripts for CPU intensive programs that suspended > rc5des, ran the program, then reenabled it again. Should have held on to > them, I guess. Check out http://people.FreeBSD.org/~green/mean.c. > > If this change > > fixes things for you, please report it asap, since my understanding is > > that this problem is rather elusive and annoying. > > No, it didn't work, unfortunately. To test it, I renice'd rc5des to a > couple of different values while encoding an MP3. It's an issue. Nice values count for less than before due to fixes that Luoqi Chen made (and I committed). The behavior now isn't optimal, but it is better than the system locking up. NICE_WEIGHT might be okay to keep at 2. Try the attached diff; I'm pretty sure it won't blow things up :) The diff should make a process at -20 which uses all available CPU schedule just slightly the ahead of a process at +20 which uses no CPU. A process which uses full CPU at 0 niceness would have a priority of 128, whereas a process using no CPU at 0 niceness would have a priority of 90. All processes will always have a priority less than or equal to 128, which is the priority at which a process with a niceness of +20 always runs at. A +20 process won't get better priority than anything else, period. Try it out, see how it works for you:) -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' --- /usr/src/sys/sys/proc.h Fri May 26 20:15:46 2000 +++ /home/green/tmp/proc.h Fri Jun 9 20:13:30 2000 @@ -405,10 +405,10 @@ * the range 100-256 Hz (approximately). */ #define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level) */ -#define NICE_WEIGHT 1 /* priorities per nice level */ +#define NICE_WEIGHT 2 /* priorities per nice level */ #define PPQ (128 / NQS) /* priorities per queue */ #define ESTCPULIM(e) \ - min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * PRIO_TOTAL - PPQ) + \ + min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * PRIO_TOTAL / 2 - PPQ) + \ INVERSE_ESTCPU_WEIGHT - 1) extern u_long ps_arg_cache_limit; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message