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 pmap: use correct types for memory allocation 2012-11-06 22:22:11 +11:00
alloc.h pmap: use correct types for memory allocation 2012-11-06 22:22:11 +11:00
COPYING miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
devname.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
devname.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
escape.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
escape.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
ksym.c miscellaneous: clean up trailing whitespace throughout 2013-03-14 12:36:47 +01:00
libprocps.pc.in Renaming libprocfs to libprocps 2011-12-23 09:18:43 +11:00
libprocps.sym procps: add support for linux namespaces 2013-04-16 15:05:21 -04:00
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 docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
pwcache.h better handling of long usernames 2004-07-20 23:31:12 +00:00
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 docs: clarification to license headers in files 2012-03-03 18:41:11 +11:00
sig.h Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
slab.c miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
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 Change restrict to __restrict in public includes 2012-01-09 21:44:51 +11:00
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