]> granicus.if.org Git - procps-ng/commit
top: reduce % CPU distortions when a core was turned off
authorJim Warner <james.warner@comcast.net>
Fri, 3 Feb 2012 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Wed, 8 Feb 2012 09:57:58 +0000 (20:57 +1100)
commita9041a5526eddc631b94bac86c09a47e60a3b4e1
treee1dcc87f507c8fb79a8244a94b0a9eaabbecdd60
parentf348575edc915db9df89acfb3f292920726ffe9a
top: reduce % CPU distortions when a core was turned off

This patch provides for cpu cores which can be turned
off completely when idle (Nehalem, etc.) thus registering
very few or no tics since the last update cycle.

When CPU_ZEROTICS is not defined (the default), any
displayed cpu with less than a certain amount of total
tics will show as 100% idle.  That amount is tempered
by the delay interval and total number of cpus.

This commit also satisfies the Debian 'top_nohz' patch
(11/24/09) in a slightly more efficient manner.  That
patch concerned kernels built with CONFIG_NO_HZ.

Reference:
http://www.freelists.org/post/procps/CStates-handling-new-switch,4
top/top.c
top/top.h