Commit Graph

21 Commits

Author SHA1 Message Date
Robert Bowmaker
463ed0049c Fix error in vmstat documentation.
Inspection of vmstat.c and experimentation with the binary itself
both confirm that the units of the swap (si/so) fields are
controlled by the --unit option.

References:
 procps-ng/procps!69
 procps-ng/procps#100

Signed-off-by: Craig Small <csmall@enc.com.au>
2018-06-23 22:15:33 +10:00
Jaromir Capik
2f96eef7f8 library: reverting tmpfs subtraction from cached (18-FEB-2014)
The subtraction was marked as reinforcing the misconception,
that memory in the page cache can be considered free.
The Cached value is not a sum of page cache and tmpfs,
as the tmpfs memory lives in the page cache and therefore
it's an inseparable part of it.
2014-04-30 13:59:34 +02:00
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
Jaromir Capik
4fcd56bf58 vmstat: Support for timestamps with '-t' & fix for '-wd'
From now the vmstat can append a timestamp to each line in the
VMSTAT and DISKSTAT mode. You can achieve that with the '-t'
switch.
The '-w' switch now works in the DISKSTAT mode too.
2014-02-04 19:10:42 +01:00
Jaromir Capik
1b97942c8e vmstat: -w switch for wider output
This is a rework of the merge request #5 that unconditionally
forced the output to cross the 80 chars border.
With this commit users can switch to the wide output mode
with the -w option.
2013-11-25 16:56:10 +01:00
Jaromir Capik
48e4be926d Minor fix with vmstat manpage for r column
The r column can mean a waiting to run OR running process. This is
cleared up in the man page now.

Signed-off-by: Craig Small <csmall@enc.com.au>
2012-05-30 21:41:17 +10:00
Jim Warner
421b08a4df all: fix misspellings in docs and program comments
We might as well join the coreutils and util-linux
projects in correcting our own typos.

The following was left unchanged:
   top/top.c[1797]: thru -> "through"

references:
http://lists.gnu.org/archive/html/coreutils/2012-04/msg00057.html
http://marc.info/?l=util-linux-ng&m=133518057419736&w=2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2012-04-25 13:46:02 +10:00
Sami Kerola
47100a8125 docs: fix manual page warnings
All warnings where about unnecessary quoting.  The scriptlet
below will tell what was wrong.

for I in ./top/top.1 ./ps/ps.1 ./*.[0-9]; do
    echo "== $I warnings =="
    man --warnings=all $I > /dev/null
done

This should probably be turned to 'make check' script.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-16 12:55:53 +02:00
Sami Kerola
5e0306f042 docs: mention long options in man vmstat.8
This commit includes generic manual clean ups as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:17:03 +01:00
Michael Tokarev
04ce4db830 vmstat: do not scale si/so just like bi/bo
Use strtoull insteadof strtoul for some counters.

A patch from Debian.

Bug-Debian: http://bugs.debian.org/558361
Bug-Debian: http://bugs.debian.org/558134
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-18 22:54:20 +11:00
Jan Görig
039e2bb7df Manual pages fixes
Taken from Debian with small changes added

Authors: Craig Small <csmall@debian.org>, Brendan O'Dea <bod@debian.org>
2011-02-23 09:17:54 +01:00
albert
9278134e49 top: show CPU time stolen from a virtual machine 2006-06-25 02:15:36 +00:00
albert
8618adeaaf got most of procps-3.1.11ff2.diff 2003-08-10 23:40:41 +00:00
albert
5c99a21b72 diskstats and slabinfo 2003-06-08 17:28:06 +00:00
albert
573423ff40 warning + doc refs 2003-06-02 23:31:12 +00:00
albert
de2857aa89 fabian.frederick@gmx.fr vmstat code 2003-05-31 00:38:55 +00:00
albert
c64633ab31 did -s and -f for rodenstein 2002-11-28 09:07:59 +00:00
albert
80ec87f55a vmstat does IO-wait 2002-11-09 02:00:52 +00:00
albert
e4d350522e mention -a 2002-10-09 04:28:48 +00:00
albert
609ee430aa vmstat man page 157935 155684 2002-10-08 19:08:34 +00:00
csmall
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00