linux/Documentation
KAMEZAWA Hiroyuki b084d4353f mm: count swap usage
A frequent questions from users about memory management is what numbers of
swap ents are user for processes.  And this information will give some
hints to oom-killer.

Besides we can count the number of swapents per a process by scanning
/proc/<pid>/smaps, this is very slow and not good for usual process
information handler which works like 'ps' or 'top'.  (ps or top is now
enough slow..)

This patch adds a counter of swapents to mm_counter and update is at each
swap events.  Information is exported via /proc/<pid>/status file as

[kamezawa@bluextal memory]$ cat /proc/self/status
Name:   cat
State:  R (running)
Tgid:   2910
Pid:    2910
PPid:   2823
TracerPid:      0
Uid:    500     500     500     500
Gid:    500     500     500     500
FDSize: 256
Groups: 500
VmPeak:    82696 kB
VmSize:    82696 kB
VmLck:         0 kB
VmHWM:       432 kB
VmRSS:       432 kB
VmData:      172 kB
VmStk:        84 kB
VmExe:        48 kB
VmLib:      1568 kB
VmPTE:        40 kB
VmSwap:        0 kB <=============== this.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-06 11:26:24 -08:00
..
ABI Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-03-03 08:48:58 -08:00
accounting
acpi
aoe
arm ARM: 5930/1: Add PKMAP area description to memory.txt. 2010-02-15 21:40:33 +00:00
auxdisplay
blackfin Blackfin: add an example showing how to use the gptimers API 2009-12-15 00:15:04 -05:00
block Merge branch 'master' into for-2.6.34 2010-02-22 13:48:51 +01:00
blockdev
cdrom ide: doc: remove compilation options section from ide-cd documentation 2009-12-13 20:41:53 -08:00
cgroups
connector
console
cpu-freq [CPUFREQ] fix default value for ondemand governor 2010-01-13 10:55:15 -05:00
cpuidle
cris
crypto
development-process
device-mapper
DocBook docbook: fix errors from x86 headers merger 2010-03-03 07:32:39 -08:00
driver-model Driver core: driver_attribute parameters can often be const* 2009-12-23 11:23:43 -08:00
dvb V4L/DVB: get_dvb_firmware: Fix typo, sort list of components 2010-02-26 15:10:56 -03:00
early-userspace
fault-injection fault injection: correct function names in documentation 2010-02-02 18:11:22 -08:00
fb viafb: documentation update 2009-12-16 07:20:05 -08:00
filesystems mm: count swap usage 2010-03-06 11:26:24 -08:00
firmware_class
frv
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2010-01-11 09:45:55 -08:00
i2c i2c: Document the message size limit 2010-03-02 12:23:49 +01:00
i2o
ia64
ide
infiniband
input Merge branch 'next' into for-linus 2010-02-28 23:55:20 -08:00
ioctl USB: vstusb.c: removal of driver for Vernier Software & Technology, Inc., devices and spectrometers 2010-03-02 14:55:08 -08:00
isdn gigaset: small documentation improvement 2010-02-26 01:24:22 -08:00
ja_JP
kbuild kbuild: generate modules.builtin 2009-12-12 13:08:16 +01:00
kdump
ko_KR
kvm KVM: trivial document fixes 2010-03-01 12:35:43 -03:00
laptops thinkpad-acpi: lock down video output state access 2010-02-25 22:22:22 -03:00
lguest lguest: remove unneeded zlib.h include in example launcher 2010-02-24 14:22:22 +10:30
m68k
make
mips
misc-devices ad525x_dpot: new driver for AD525x digital potentiometers 2009-12-15 08:53:25 -08:00
mn10300
mtd
namespaces
netlabel
networking Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-03-03 08:48:58 -08:00
parisc
PCI Documentation: Rename Documentation/DMA-mapping.txt 2010-01-02 10:09:44 -08:00
pcmcia pcmcia: use ops_mutex for rsrc_{mgr,nonstatic} locking 2010-02-17 17:48:24 +01:00
power PM: Runtime PM documentation update 2009-12-22 20:43:40 +01:00
powerpc Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2010-03-04 08:20:14 -08:00
pps
prctl
RCU rcu: Use canonical URL for Mathieu's dissertation 2010-02-25 10:34:56 +01:00
s390 [S390] cio: introduce cio_settle 2010-02-26 22:37:29 +01:00
scheduler
scsi [SCSI] megaraid_sas: version and documentation update 2010-02-17 13:13:00 -06:00
serial
sh
sound Merge branch 'topic/hda' into for-linus 2010-03-01 12:38:54 +01:00
sparc
spi
sysctl
telephony
thermal
timers
trace Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-02-28 10:20:25 -08:00
uml
usb USB: convert to the runtime PM framework 2010-03-02 14:54:12 -08:00
video4linux V4L/DVB: Documentation: gspca.txt: update known mr97310a cams 2010-02-26 15:11:09 -03:00
vm failslab: add ability to filter slab caches 2010-02-26 19:19:39 +02:00
w1
watchdog
wimax
x86 x86, numa: Remove configurable node size support for numa emulation 2010-02-15 14:34:18 -08:00
zh_CN
00-INDEX
applying-patches.txt
atomic_ops.txt
bad_memory.txt
basic_profiling.txt
binfmt_misc.txt
braille-console.txt
bt8xxgpio.txt
btmrvl.txt
BUG-HUNTING
cachetlb.txt Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
Changes netfilter: xtables: document minimal required version 2009-12-14 14:52:10 +01:00
CodingStyle
cpu-hotplug.txt cpumask: don't recommend set_cpus_allowed hack in Documentation/cpu-hotplug.txt 2009-12-17 11:43:29 +10:30
cpu-load.txt
cputopology.txt
credentials.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
devices.txt
DMA-API.txt
DMA-attributes.txt
DMA-ISA-LPC.txt
dmaengine.txt
dontdiff Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-kconfig 2010-02-25 14:43:57 -08:00
dynamic-debug-howto.txt
edac.txt
eisa.txt
email-clients.txt
feature-removal-schedule.txt Merge branch 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2010-03-05 13:12:34 -08:00
flexible-arrays.txt
futex-requeue-pi.txt
gcov.txt
gpio.txt gpiolib: add support for changing value polarity in sysfs 2009-12-16 07:20:01 -08:00
highuid.txt
HOWTO
hw_random.txt
initrd.txt
intel_txt.txt
Intel-IOMMU.txt
io_ordering.txt
io-mapping.txt
IO-mapping.txt Documentation: fix ioremap return type 2010-01-02 10:09:44 -08:00
iostats.txt
IPMI.txt
IRQ-affinity.txt
IRQ.txt
irqflags-tracing.txt
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt documentation: update kernel-doc-nano-HOWTO information 2010-01-11 09:34:07 -08:00
kernel-docs.txt
kernel-parameters.txt Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-03 08:15:37 -08:00
keys-request-key.txt
keys.txt
kmemcheck.txt
kmemleak.txt
kobject.txt
kprobes.txt kprobes: Add documents of jump optimization 2010-02-25 17:49:27 +01:00
kref.txt
ldm.txt
leds-class.txt
leds-lp3944.txt
local_ops.txt
lockdep-design.txt
lockstat.txt
logo.gif
logo.txt
magic-number.txt
Makefile
ManagementStyle
mca.txt
md.txt md: add 'recovery_start' per-device sysfs attribute 2009-12-14 12:58:57 +11:00
memory-barriers.txt
memory-hotplug.txt mm: add numa node symlink for memory section in sysfs 2009-12-15 08:53:17 -08:00
memory.txt
mono.txt
mutex-design.txt
nmi_watchdog.txt
nommu-mmap.txt nommu: fix malloc performance by adding uninitialized flag 2009-12-15 08:53:24 -08:00
numastat.txt
oops-tracing.txt
parport-lowlevel.txt
parport.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
printk-formats.txt
prio_tree.txt
rbtree.txt
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rt-mutex-design.txt
rt-mutex.txt
rtc.txt
SAK.txt
SecurityBugs
SELinux.txt
serial-console.txt
sgi-ioc4.txt
sgi-visws.txt
slow-work.txt
SM501.txt
Smack.txt
sparse.txt
spinlocks.txt Documentation: rw_lock lessons learned 2009-12-14 09:46:56 -08:00
stable_api_nonsense.txt
stable_kernel_rules.txt Doc/stable rules: add new cherry-pick logic 2009-12-23 11:23:43 -08:00
SubmitChecklist doc: SubmitChecklist, add ioctls, remove OSDL reference 2009-12-16 07:20:06 -08:00
SubmittingDrivers
SubmittingPatches
svga.txt
sysfs-rules.txt
sysrq.txt
tomoyo.txt
unaligned-memory-access.txt
unicode.txt
unshare.txt
VGA-softcursor.txt
vgaarbiter.txt vgaarbiter: fix a typo in the vgaarbiter Documentation 2009-12-16 11:28:58 -08:00
video-output.txt
volatile-considered-harmful.txt
voyager.txt
zorro.txt