proc.5: statm's "shared" field refers to pages backed by files

I noticed that statm's "shared" field doesn't match the sum of
all the "shared" entries in smaps [1].

The kernel docs explain that statm's "shared" field is "number of
pages that are shared (i.e. backed by a file)" [2].  smaps appears
to call a page shared if it's mapped by at least two processes,
which explains this discrepancy.

I'm not a kernel hacker, but it appears to me they do mean "i.e."
and not "e.g." in the statm description: In
fs/proc/task_mmu.c::task_statm, I see

    *shared = get_mm_counter(mm, MM_FILEPAGES);

Here's a patch which updates the man page to match the (hopefully
correct) kernel docs.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=807181
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documentation/filesystems/proc.txt;h=a1793d670cd01bd374eddf54ffdfc768504291ff;hb=HEAD

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Justin Lebar 2012-12-26 23:22:38 +01:00 committed by Michael Kerrisk
parent 4cb1deb76f
commit 04dcb3c8f8
1 changed files with 1 additions and 1 deletions

View File

@ -1026,7 +1026,7 @@ size total program size
(same as VmSize in \fI/proc/[pid]/status\fP)
resident resident set size
(same as VmRSS in \fI/proc/[pid]/status\fP)
share shared pages (from shared mappings)
share shared pages (i.e., backed by a file)
text text (code)
.\" (not including libs; broken, includes data segment)
lib library (unused in Linux 2.6)