Date: Mon, 8 Dec 1997 20:19:31 -0200 (EDT) From: Joao Carlos Mendes Luis <jonny@coppe.ufrj.br> To: freebsd-hackers@freebsd.org Subject: Process scheduling: nice does not work ??? Message-ID: <199712082219.UAA13229@gaia.coppe.ufrj.br>
next in thread | raw e-mail | index | archive | help
Hi,
I've been doing some test with cpu-intensive scheduling in FreeBSD
2.2-stable, when I found what seems to be an error in the scheduler.
If I run two cpu intensive processes, one with niceness 0, and the other
with niceness 20, the CPU is divided this way (using rc564 key crunsher
just to give an example of cpu-intensive task):
last pid: 17789; load averages: 2.02, 2.11, 2.08 20:06:38
63 processes: 3 running, 58 sleeping, 1 stopped, 1 zombie
CPU states: 67.8% user, 31.8% nice, 0.0% system, 0.4% interrupt, 0.0% idle
Mem: 72M Active, 14M Inact, 15M Wired, 8344K Buf, 23M Free
Swap: 128M Total, 64K Used, 128M Free
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
17676 jonny 105 0 872K 420K RUN 2:06 65.81% 65.80% rc564
303 jonny 105 20 824K 404K RUN 488:14 33.04% 33.04% rc564
17714 root 28 0 720K 940K RUN 0:00 0.00% 0.00% top
But, if instead I give nicenesses 10 and 20, it's divided like this:
last pid: 17796; load averages: 2.06, 2.05, 2.06 20:11:07
63 processes: 3 running, 58 sleeping, 1 stopped, 1 zombie
CPU states: 0.0% user, 99.2% nice, 0.4% system, 0.4% interrupt, 0.0% idle
Mem: 72M Active, 14M Inact, 15M Wired, 8344K Buf, 23M Free
Swap: 128M Total, 64K Used, 128M Free
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
303 jonny 105 20 824K 404K RUN 490:27 50.66% 50.66% rc564
17676 jonny 105 10 872K 420K RUN 4:21 48.07% 48.07% rc564
263 root 18 0 500K 860K pause 0:03 0.04% 0.04% httpd
17714 root 28 0 720K 940K RUN 0:00 0.00% 0.00% top
So, why there's no difference between niceness 10 and 20 ? idprio
is not a solution, because the idprio'd process will never run. I want
it to run, but with a smaller priority than another one.
I've also tested this behaviour for Linux 2.0.32 and Solaris 2.5,
just for comparison purposes.
In linux:
7:43pm up 9:25, 2 users, load average: 1.81, 1.19, 0.64
59 processes: 55 sleeping, 4 running, 0 zombie, 0 stopped
CPU states: 96.8% user, 2.9% system, 97.3% nice, 0.7% idle
Mem: 63232K av, 61864K used, 1368K free, 21504K shrd, 23612K buff
Swap: 130748K av, 0K used, 130748K free 14168K cached
PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
5497 jonny 16 10 268 268 204 R N 0 80.4 0.4 1:12 rc564
5358 jonny 20 19 284 284 220 R N 0 16.2 0.4 11:26 rc564
5511 root 1 0 540 540 404 R 0 0.7 0.8 0:00 top
And in Solaris:
last pid: 2623; load averages: 2.00, 1.63, 1.32 19:59:15
64 processes: 58 sleeping, 4 running, 1 stopped, 1 on cpu
Cpu states: 0.0% idle, 99.0% user, 1.0% kernel, 0.0% iowait, 0.0% swap
Memory: 113M real, 22M free, 34M swap, 316M free swap
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
2617 jonny -25 10 1600K 1056K run 2:41 60.74% 61.62% rc564-sparc-no
261 jonny -25 19 1744K 1316K run 494:52 41.44% 41.01% rc564-sparc-no
3 root 35 -20 0K 0K sleep 2:07 0.43% 0.38% fsflush
2616 root 33 0 2160K 1604K cpu 0:01 0.36% 0.35% top
2567 root 33 0 1544K 1152K sleep 0:00 0.04% 0.08% sshd
Jonny
--
Joao Carlos Mendes Luis jonny@gta.ufrj.br
+55 21 290-4698 jonny@coppe.ufrj.br
Universidade Federal do Rio de Janeiro UFRJ/COPPE/CISI
PGP fingerprint: 29 C0 50 B9 B6 3E 58 F2 83 5F E3 26 BF 0F EA 67
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712082219.UAA13229>
