mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
![Luigi Semenzato](/assets/img/avatar_default.png)
Report separate components (anon, file, and shmem) for PSS in smaps_rollup. This helps understand and tune the memory manager behavior in consumer devices, particularly mobile devices. Many of them (e.g. chromebooks and Android-based devices) use zram for anon memory, and perform disk reads for discarded file pages. The difference in latency is large (e.g. reading a single page from SSD is 30 times slower than decompressing a zram page on one popular device), thus it is useful to know how much of the PSS is anon vs. file. All the information is already present in /proc/pid/smaps, but much more expensive to obtain because of the large size of that procfs entry. This patch also removes a small code duplication in smaps_account, which would have gotten worse otherwise. Also updated Documentation/filesystems/proc.txt (the smaps section was a bit stale, and I added a smaps_rollup section) and Documentation/ABI/testing/procfs-smaps_rollup. [semenzato@chromium.org: v5] Link: http://lkml.kernel.org/r/20190626234333.44608-1-semenzato@chromium.org Link: http://lkml.kernel.org/r/20190626180429.174569-1-semenzato@chromium.org Signed-off-by: Luigi Semenzato <semenzato@chromium.org> Acked-by: Yu Zhao <yuzhao@chromium.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Yu Zhao <yuzhao@chromium.org> Cc: Brian Geffon <bgeffon@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
41 lines
1.3 KiB
Text
41 lines
1.3 KiB
Text
What: /proc/pid/smaps_rollup
|
|
Date: August 2017
|
|
Contact: Daniel Colascione <dancol@google.com>
|
|
Description:
|
|
This file provides pre-summed memory information for a
|
|
process. The format is almost identical to /proc/pid/smaps,
|
|
except instead of an entry for each VMA in a process,
|
|
smaps_rollup has a single entry (tagged "[rollup]")
|
|
for which each field is the sum of the corresponding
|
|
fields from all the maps in /proc/pid/smaps.
|
|
Additionally, the fields Pss_Anon, Pss_File and Pss_Shmem
|
|
are not present in /proc/pid/smaps. These fields represent
|
|
the sum of the Pss field of each type (anon, file, shmem).
|
|
For more details, see Documentation/filesystems/proc.txt
|
|
and the procfs man page.
|
|
|
|
Typical output looks like this:
|
|
|
|
00100000-ff709000 ---p 00000000 00:00 0 [rollup]
|
|
Size: 1192 kB
|
|
KernelPageSize: 4 kB
|
|
MMUPageSize: 4 kB
|
|
Rss: 884 kB
|
|
Pss: 385 kB
|
|
Pss_Anon: 301 kB
|
|
Pss_File: 80 kB
|
|
Pss_Shmem: 4 kB
|
|
Shared_Clean: 696 kB
|
|
Shared_Dirty: 0 kB
|
|
Private_Clean: 120 kB
|
|
Private_Dirty: 68 kB
|
|
Referenced: 884 kB
|
|
Anonymous: 68 kB
|
|
LazyFree: 0 kB
|
|
AnonHugePages: 0 kB
|
|
ShmemPmdMapped: 0 kB
|
|
Shared_Hugetlb: 0 kB
|
|
Private_Hugetlb: 0 kB
|
|
Swap: 0 kB
|
|
SwapPss: 0 kB
|
|
Locked: 385 kB
|