]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix CPU load reporting independent of scheduler used.
authorUlrich Spörlein <uqs@FreeBSD.org>
Thu, 28 Oct 2010 20:18:26 +0000 (20:18 +0000)
committerUlrich Spörlein <uqs@FreeBSD.org>
Thu, 28 Oct 2010 20:18:26 +0000 (20:18 +0000)
commitac203a768d502696aa91f2f2ebc773311a456892
treee2490a24a3989f779a6242ca0273ecbfa73ddb4c
parentc2ab553ee5c27b55e8d7628a6c2ec5854817c41d
Fix CPU load reporting independent of scheduler used.

- Sample CPU usage data from kern.cp_times, this makes for a far more
  accurate and scheduler independent algorithm.
- Rip out the process list scraping that is no longer required.
- Don't update CPU usage sampling on every request, but every 15s
  instead. This makes it impossible for an attacker to hide the CPU load
  by triggering 4 samplings in short succession when the system is idle.
- After reaching the steady-state, the system will always report the
  average CPU load of the last 60 sampled seconds.
- Untangling of call graph.

PR: kern/130222
Tested by: Julian Dunn <jdunn@aquezada.com>
Gustau Pérez <gperez@entel.upc.edu>
Jürgen Weiß <weiss@uni-mainz.de>
MFC after: 2 weeks

I'm unsure if some MIB standard states this must be the load average
for, eg. 300s, it looks like net-snmp isn't even bothering to implement
the CPU load reporting at all.
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c