linux/Documentation/filesystems
Jerome Marchand 8cee852ec5 mm, procfs: breakdown RSS for anon, shmem and file in /proc/pid/status
There are several shortcomings with the accounting of shared memory
(SysV shm, shared anonymous mapping, mapping of a tmpfs file).  The
values in /proc/<pid>/status and <...>/statm don't allow to distinguish
between shmem memory and a shared mapping to a regular file, even though
theirs implication on memory usage are quite different: during reclaim,
file mapping can be dropped or written back on disk, while shmem needs a
place in swap.

Also, to distinguish the memory occupied by anonymous and file mappings,
one has to read the /proc/pid/statm file, which has a field for the file
mappings (again, including shmem) and total memory occupied by these
mappings (i.e.  equivalent to VmRSS in the <...>/status file.  Getting
the value for anonymous mappings only is thus not exactly user-friendly
(the statm file is intended to be rather efficiently machine-readable).

To address both of these shortcomings, this patch adds a breakdown of
VmRSS in /proc/<pid>/status via new fields RssAnon, RssFile and
RssShmem, making use of the previous preparatory patch.  These fields
tell the user the memory occupied by private anonymous pages, mapped
regular files and shmem, respectively.  Other existing fields in /status
and /statm files are left without change.  The /statm file can be
extended in the future, if there's a need for that.

Example (part of) /proc/pid/status output including the new Rss* fields:

VmPeak:  2001008 kB
VmSize:  2001004 kB
VmLck:         0 kB
VmPin:         0 kB
VmHWM:      5108 kB
VmRSS:      5108 kB
RssAnon:              92 kB
RssFile:            1324 kB
RssShmem:           3692 kB
VmData:      192 kB
VmStk:       136 kB
VmExe:         4 kB
VmLib:      1784 kB
VmPTE:      3928 kB
VmPMD:        20 kB
VmSwap:        0 kB
HugetlbPages:          0 kB

[vbabka@suse.cz: forward-porting, tweak changelog]
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-14 16:00:49 -08:00
..
caching FS-Cache: Count the number of initialised operations 2015-04-02 14:28:53 +01:00
cifs
configfs configfs: implement binary attributes 2016-01-04 12:31:46 +01:00
nfs ipconfig: send Client-identifier in DHCP requests 2015-10-18 19:23:52 -07:00
pohmelfs
.gitignore
00-INDEX
9p.txt
Locking switch ->get_link() to delayed_call, kill ->put_link() 2015-12-30 13:01:03 -05:00
Makefile configfs: remove old API 2015-10-13 22:17:57 -07:00
adfs.txt
affs.txt
afs.txt
autofs4-mount-control.txt
autofs4.txt
automount-support.txt Documentation: remove outdated information from automount-support.txt 2015-05-15 01:10:38 -04:00
befs.txt
bfs.txt
btrfs.txt Documentation: filesystems: btrfs: Fixed typos and whitespace 2015-07-09 14:31:06 -06:00
ceph.txt
coda.txt
cramfs.txt
dax.txt dax: add huge page fault support 2015-09-08 15:35:28 -07:00
debugfs.txt debugfs: Pass bool pointer to debugfs_create_bool() 2015-10-04 11:36:07 +01:00
devpts.txt
directory-locking
dlmfs.txt
dnotify.txt
dnotify_test.c
ecryptfs.txt
efivarfs.txt
exofs.txt
ext2.txt fs: Remove ext3 filesystem driver 2015-07-23 20:59:40 +02:00
ext3.txt fs: Remove ext3 filesystem driver 2015-07-23 20:59:40 +02:00
ext4.txt
f2fs.txt f2fs: introduce new option for controlling data flush 2015-12-16 09:25:48 -08:00
fiemap.txt
files.txt
fuse.txt
gfs2-glocks.txt gfs2: Remove gl_spin define 2015-10-29 12:57:48 -05:00
gfs2-uevents.txt
gfs2.txt
hfs.txt
hfsplus.txt
hpfs.txt
inotify.txt
isofs.txt
jfs.txt
locks.txt
logfs.txt
mandatory-locking.txt
ncpfs.txt
nilfs2.txt
ntfs.txt
ocfs2.txt
omfs.txt
overlayfs.txt Remove email address from Documentation/filesystems/overlayfs.txt 2015-11-11 10:04:53 -07:00
path-lookup.md Documentation: add new description of path-name lookup. 2015-11-02 18:18:25 -07:00
path-lookup.txt Documentation: add new description of path-name lookup. 2015-11-02 18:18:25 -07:00
porting switch ->get_link() to delayed_call, kill ->put_link() 2015-12-30 13:01:03 -05:00
proc.txt mm, procfs: breakdown RSS for anon, shmem and file in /proc/pid/status 2016-01-14 16:00:49 -08:00
qnx6.txt
quota.txt quota: Update documentation 2015-05-18 11:23:07 +02:00
ramfs-rootfs-initramfs.txt
relay.txt
romfs.txt
seq_file.txt
sharedsubtree.txt
spufs.txt
squashfs.txt
sysfs-pci.txt
sysfs-tagging.txt sysfs-tagging.txt: fix pre-kernfs references 2015-09-13 14:38:51 -06:00
sysfs.txt sysfs.txt: mention that store method buffers are null-terminated 2015-09-13 14:38:51 -06:00
sysv-fs.txt
tmpfs.txt
ubifs.txt
udf.txt
ufs.txt
vfat.txt
vfs.txt switch ->get_link() to delayed_call, kill ->put_link() 2015-12-30 13:01:03 -05:00
xfs-delayed-logging-design.txt
xfs-self-describing-metadata.txt
xfs.txt xfs: fix kernel version in docs 2015-06-01 07:15:38 +10:00