Skip to content

Commit 0bc126d

Browse files
rfrhttorvalds
authored andcommitted
Documentation/filesystems: describe the shared memory usage/accounting
The Shared Memory accounting support is present in Kernel since commit 4b02108 ("mm: oom analysis: add shmem vmstat") and in userland free(1) since 2014. This patch updates the Documentation to reflect this change. Signed-off-by: Rodrigo Freire <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6f754ba commit 0bc126d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Documentation/filesystems/proc.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ Dirty: 968 kB
855855
Writeback: 0 kB
856856
AnonPages: 861800 kB
857857
Mapped: 280372 kB
858+
Shmem: 644 kB
858859
Slab: 284364 kB
859860
SReclaimable: 159856 kB
860861
SUnreclaim: 124508 kB
@@ -911,6 +912,7 @@ MemAvailable: An estimate of how much memory is available for starting new
911912
AnonPages: Non-file backed pages mapped into userspace page tables
912913
AnonHugePages: Non-file backed huge pages mapped into userspace page tables
913914
Mapped: files which have been mmaped, such as libraries
915+
Shmem: Total memory used by shared memory (shmem) and tmpfs
914916
Slab: in-kernel data structures cache
915917
SReclaimable: Part of Slab, that might be reclaimed, such as caches
916918
SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure

Documentation/filesystems/tmpfs.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ RAM, where you have to create an ordinary filesystem on top. Ramdisks
1717
cannot swap and you do not have the possibility to resize them.
1818

1919
Since tmpfs lives completely in the page cache and on swap, all tmpfs
20-
pages currently in memory will show up as cached. It will not show up
21-
as shared or something like that. Further on you can check the actual
22-
RAM+swap use of a tmpfs instance with df(1) and du(1).
23-
20+
pages will be shown as "Shmem" in /proc/meminfo and "Shared" in
21+
free(1). Notice that these counters also include shared memory
22+
(shmem, see ipcs(1)). The most reliable way to get the count is
23+
using df(1) and du(1).
2424

2525
tmpfs has the following uses:
2626

0 commit comments

Comments
 (0)