Bug 142994 - Per-process shared memory is greater than resident memory
Per-process shared memory is greater than resident memory
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
http://linux.bkbits.net:8080/linux-2....
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-15 12:08 EST by Lev Makhlis
Modified: 2015-01-04 17:14 EST (History)
2 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Lev Makhlis 2004-12-15 12:08:33 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20041020

Description of problem:
Quoting Hugh Dickins:
"The third "shared" field of /proc/$pid/statm in 2.4 was a count of
pages in the mm whose page_count is more than 1 (oddly, including
pages shared just with swapcache).  That's too costly to calculate
each time, so 2.6 changed it to the total file-backed extent.  But
Andrea knows apps and users surprised when (rss - shared) goes
negative: we need to provide an rss-like statistic, close to the 2.4
interpretation.

Something that's quick and easy to maintain accurately is
mm->anon_rss, the count of anonymous pages in the mm.  Then shared =
rss - anon_rss gives a pretty good and meaningful approximation to
2.4's intention: wli confirms that this will be useful to Oracle too."

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

How reproducible:
Always

Steps to Reproduce:
1. Run "top"

    

Actual Results:    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM  
 TIME+  COMMAND
 3098 root      17   0  3292  924 1664 R  1.0  0.5   0:01.11 top


Expected Results:  SHR < RES

Additional info:

Please consider merging Hugh's patches from 2.6.10-rc2:
http://linux.bkbits.net:8080/linux-2.5/cset@1.2026.12.193
http://linux.bkbits.net:8080/linux-2.5/cset@1.2026.12.194
Comment 1 Jason Baron 2004-12-15 12:27:02 EST
these have been merged already. thanks.

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