]> granicus.if.org Git - procps-ng/commit
top: tweak the new 'reduce % CPU distortions' algorithm
authorJim Warner <james.warner@comcast.net>
Tue, 7 Feb 2012 16:10:10 +0000 (10:10 -0600)
committerCraig Small <csmall@enc.com.au>
Wed, 8 Feb 2012 10:00:00 +0000 (21:00 +1100)
commit9e7dd43ab7b2e68177cefd49b3c07311ea79bc1a
tree84aa1fb12df46d5002d9785c09533c3323fc204e
parenta9041a5526eddc631b94bac86c09a47e60a3b4e1
top: tweak the new 'reduce % CPU distortions' algorithm

The original approach to potential % CPU distortion due
to Nehalem type cores being turned off completely when
idle worked ok until the user typed something.

At that point, elapsed tics would no longer equal the
calculated value producing an undesirable 100% idle
condition until the next update or <Enter/Space> key.

This commit employs actual elapsed tics in determining
whether a cpu should be considered idle and thus makes
top's individual cpu display immune to user keystrokes.
top/top.c
top/top.h