Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 1998 08:24:22 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hackers@FreeBSD.ORG
Subject:   The nice Problem
Message-ID:  <199803180724.IAA00156@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
Hi,

a friend who is not on this list sent me the attached message.
According to him, a process like "main(){while(1);}" run with
/usr/bin/nice -20 in the background severely slows down compilations on
FreeBSD 2.2.5.

He suspects that the reason is, when io bound processes are woken
up, the running process with lower priority is somwhow not interrupted.
I am not able to reproduce the problem here on 2.2.1 but perhaps i have
too much memory for the tests i have run.

Can anyone comment on this, and if there is some specific difference
between 2.2.1 and later version of the system which could lead to such
a behaviour ?

	thanks
	luigi

> Basic question: In what way does the priority of processes interact
> 	with scheduling ?
> or: Why aren't processes scheduled differently based on "IO boundness" ?
> 
> I have some code which compiles in 8 sec (14 sec real time, see below
> for details).  However, if I at the same time run a CPU bound program,
> even with low priority, the compile takes the same time (measured in 
> cpu time) but more than twice as long in real time.  FYI, I run 
> the following progam to obtain the numbers below:
> 	main(){while(1);}
> 
> Please look at these numbers:
> 	FreeBSD compile
> 		14.70 real         8.54 user        1.71 sys
> 	FreeBSD compile with process in nice -20
> 		48.25 real         8.65 user        1.62 sys
> 	FreeBSD compile with process not in nice
> 		56.82 real         8.67 user         1.50 sys
> 
> 	NetBSD compile
> 		27.16 real         15.16 user       5.38 sys
> 	NetBSD compile with process in nice -20
> 		29.11 real         15.28 user       4.30 sys
> 	NetBSD compile with process not in nice
> 		32.63 real         15.37 user       5.60 sys
> 
> (The machine running NetBSD is one year old, and is only half as fast
> as my new machine).
> 
> Under NetBSD, a process with low priority does not affect a process 
> running in normal priority, the compile is less than 10% slower.  
> Furthermore, a CPU bound process interferes very little with an IO 
> bound process (less than 20%); Linux behaves the same way (thanx to
> johnm@cs.uit.no)  This is, to say it mildly, not the case with FreeBSD.  
> Since I need to run a process continously in the background (see 
> http://ashpool.hpl.hp.com/~ecc) I must have a system that will give 
> priority to "forground" jobs.  How do I achieve this om FreeBSD, 
> something that is normal on all other systems I have used over the 
> years.
> 
> Context (from dmesg):
> 	FreeBSD 2.2.5-RELEASE #0: Mon Mar 16 12:32:57 CET 1998
> 		tage@dslab5.cs.uit.no:/usr/src/sys/compile/DSLAB5
> 	CPU: Pentium Pro (300.01-MHz 686-class CPU)
> 		Origin = "GenuineIntel"  Id = 0x634  Stepping=4
> 		Features=0x80fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,
> 			APIC,<b11>,MTRR,PGE,MCA,CMOV>
> 	real memory  = 268435456 (262144K bytes)
> 
> FreeBSD was installed without modification.  I run FreeBSD since my
> system is a dual-processor box, awaiting upgrade to 3.0 with SMP 
> support.  Please, save me from Linux; NetBSD has no SMP support yet.


-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803180724.IAA00156>