procps/proc
Jakob Unterwurzacher 3569c0351f library: properly handle memory used by tmpfs
tmpfs has become much more widely used since distributions use it for
/tmp (Fedora 18+). In /proc/meminfo, memory used by tmpfs is accounted
into "Cached" (aka "NR_FILE_PAGES",
 http://lxr.free-electrons.com/source/mm/shmem.c#L301 ).

The tools just pass it on, so what top, free and vmstat report as
"cached" is the sum of page cache and tmpfs.

free has the extremely useful "-/+ buffers/cache" output. However, now
that tmpfs is accounted into "cached", those numbers are way off once
you have big files in /tmp.

Fortunately, kernel 2.6.32 introduces "Shmem", which makes tmpfs memory
usage accessible from userspace (
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4b02108ac1b3354a22b0d83c684797692efdc395 ).

This patch substracts Shmem from Cached to get the actual page cache
memory. This makes both issues mentioned above disappear. For older
kernels, Shmem is not available (hence zero) and this patch is no-op.

Additionally:
* Update the man pages of free and vmstat to explain what is happening
* Finally drop "MemShared" from the /proc/meminfo parser, it has been
  dead for 10+ years and is only causing confusion ( removed in kernel
  2.5.54, see
  https://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/?id=fe04e9451e5a159247cf9f03c615a4273ac0c571 )
2014-02-27 14:07:10 +01:00
..
alloc.c
alloc.h
COPYING
devname.c
devname.h
escape.c
escape.h
ksym.c
libprocps.pc.in
libprocps.sym
Makefile.am Update the library version to 3:0:0 2013-12-03 22:16:18 +11:00
procps.h Two new options for pmap, -X and -XX 2012-09-27 22:08:04 +10:00
pwcache.c
pwcache.h
readproc.c library: skip replacement of trailing '\0' in read_unvectored() 2014-01-24 18:32:20 +01:00
readproc.h library: normalize recently added namespaces interface 2013-11-25 20:57:32 +11:00
sig.c
sig.h
slab.c
slab.h Increase slab name from 64 to 128 characters 2012-06-26 22:01:42 +10:00
sysinfo.c library: properly handle memory used by tmpfs 2014-02-27 14:07:10 +01:00
sysinfo.h library: properly handle memory used by tmpfs 2014-02-27 14:07:10 +01:00
version.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
version.h name change: procps -> procps-ng 2011-06-04 20:50:12 +02:00
wchan.h
whattime.c library: fixing uninitialized variable 'pos' in whattime.c 2014-01-02 18:21:31 +01:00
whattime.h Add -p|--pretty option to uptime(1) for pretty output. 2012-02-22 10:35:12 -05:00