Fix p_pctcpu and p_estcpu. When the new systimer stuff was put in the
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 20 Mar 2004 19:16:24 +0000 (19:16 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 20 Mar 2004 19:16:24 +0000 (19:16 +0000)
commit9b173e69cf3f1d225e2ce321021d2f916b60b0ce
treee465e84c53ff56cb01a4f253defcead1dc2c0ba0
parent030f399dac381fc193d31c47fed7b9f17fa2558f
Fix p_pctcpu and p_estcpu.  When the new systimer stuff was put in the
scheduler got its own clock interrupt for scheduling updates which was set
to 10Hz.  pctcpu was still being calculated based on 100hz, so change that
to 10hz.

The systimer stuff also broke estcpu, which in turn broke NICE.  Change
the estcpu equations to operate properly and get rid of some crufty comments.

Note that NICE really works now.  A cpu-bound nice +20 process will get
very little cpu relative to a cpu-bounce nice +0 process, and none relative
to a negatively-niced process.  From a standing start each nice level of
difference immediately shifts about 5% of the cpu between processes.  Once
the load and estcpu has stabilized (if the processes are cpu-bound), the
difference is around 2% per level, for two processes.  When starting a
highly-niced process in the face of lower-niced cpu-bound processes, the
highly-niced process may not get any cpu at all for up to 60 seconds.  This
is because the system 1-min loadav is used to scale estcpu.
sys/kern/kern_exit.c
sys/kern/kern_synch.c