Bug 55862 - top resource usage
top resource usage
Product: Red Hat Linux
Classification: Retired
Component: procps (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-11-07 16:45 EST by Frank Hirtz
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-11 07:54:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Frank Hirtz 2001-11-07 16:45:56 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010917

Description of problem:
It appears that certain kinds of processes - threaded apps in particular,
but not all of them - cause top to consume lots of cpu (mostly in system
usage, not user). This has been tracked down to access to the
/proc/$pid/statm (and sometimes stat) files being the cpu-hogging calls.

"time cat /proc/$pid/statm" looks like this for a process that negatively
impacts top cpu usage:
# time cat /proc/14080/statm
577836 577747 2192 321 255475 321951 575555

real    0m0.21s
user    0m0.00s
sys     0m0.20s

while the same command for most processes looks like this:
# time cat /proc/16577/statm
202 202 180 7 0 195 26

real    0m0.00s
user    0m0.00s
sys     0m0.00s

"ps" on the processes also seems to crawl when looking at those processes.

This doesn't appear to happen when using any particular kernel version - it
happens or doesn't based on the processes running on the machine.

--Red Hat has looked into this and it appears that it is due to a 
costly entry in /proc.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Run highly threaded app.
2.Run top

Additional info:
Comment 1 Frank Hirtz 2002-07-08 11:14:11 EDT
 I believe that this was addressed with the statm patches which are now in advanced server.

Note You need to log in before you can comment on or make changes to this bug.