Skip to contentSkip to conversation

Documentation: Describe the shared memory usage/accounting

PATCH Superseded Rodrigo Freire 2 participants 5 messages Nov 19, 2015 – Dec 22, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Documentation: Describe the shared memory usage/accounting

The Shared Memory accounting support is present in Kernel since commit 4b02108ac1b3 ("mm: oom analysis: add shmem vmstat") and in userland free(1) since 2014. This patch updates the Documentation to reflect this change.

---

Documentation/filesystems/proc.txt +2 -0
@@ -842,6 +842,7 @@
 Writeback:           0 kB
 AnonPages:      861800 kB
 Mapped:         280372 kB
+Shmem:             644 kB
 Slab:           284364 kB
 SReclaimable:   159856 kB
 SUnreclaim:     124508 kB
@@ -898,6 +899,7 @@
    AnonPages: Non-file backed pages mapped into userspace page tables
 AnonHugePages: Non-file backed huge pages mapped into userspace page tables
       Mapped: files which have been mmaped, such as libraries
+       Shmem: Total memory used by shared memory (shmem) and tmpfs
         Slab: in-kernel data structures cache
 SReclaimable: Part of Slab, that might be reclaimed, such as caches
   SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure
Documentation/filesystems/tmpfs.txt +4 -4
@@ -17,10 +17,10 @@
 cannot swap and you do not have the possibility to resize them. 
 
 Since tmpfs lives completely in the page cache and on swap, all tmpfs
-pages currently in memory will show up as cached. It will not show up
-as shared or something like that. Further on you can check the actual
-RAM+swap use of a tmpfs instance with df(1) and du(1).
-
+pages will be shown in /proc/meminfo as "Shmem" and "Shared" in
+free(1). Notice that shared memory pages (see ipcs(1)) will be also
+counted as shared memory. The most reliable way to get the count is
+using df(1) and du(1).
 
 tmpfs has the following uses:
 

---
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw

PATCH RESEND 1/1 Documentation: Describe the shared memory usage/accounting

The Shared Memory accounting support is present in Kernel since commit 4b02108ac1b3 ("mm: oom analysis: add shmem vmstat") and in userland free(1) since 2014. This patch updates the Documentation to reflect this change.

---

Documentation/filesystems/proc.txt +0 -0
@@ -842,6 +842,7 @@ 

Writeback: 0 kB
AnonPages: 861800 kB
Mapped: 280372 kB
+Shmem: 644 kB
Slab: 284364 kB
SReclaimable: 159856 kB
SUnreclaim: 124508 kB
@@ -898,6 +899,7 @@
AnonPages: Non-file backed pages mapped into userspace page tables
AnonHugePages: Non-file backed huge pages mapped into userspace page tables
Mapped: files which have been mmaped, such as libraries
+ Shmem: Total memory used by shared memory (shmem) and tmpfs
Slab: in-kernel data structures cache
SReclaimable: Part of Slab, that might be reclaimed, such as caches
SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure

Documentation/filesystems/tmpfs.txt +0 -0
@@ -17,10 +17,10 @@ 

cannot swap and you do not have the possibility to resize them.

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

tmpfs has the following uses:

---
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
In reply to Rodrigo Freire
Quoted 7 lines · Rodrigo Freire

The Shared Memory accounting support is present in Kernel since commit 4b02108ac1b3 ("mm: oom analysis: add shmem vmstat") and in userland free(1) since 2014. This patch updates the Documentation to reflect this change.

You should send to Andrew Morton and maybe CC Hugh Dickins at the very least. Sending just to mailing list doesn't guarantee maintainers will pick it up due to the high volume there. Also note that your RESEND has broken whitespace.

Quoted 22 lines

---

Documentation/filesystems/proc.txt +2 -0
@@ -842,6 +842,7 @@
  Writeback:           0 kB
  AnonPages:      861800 kB
  Mapped:         280372 kB
+Shmem:             644 kB
  Slab:           284364 kB
  SReclaimable:   159856 kB
  SUnreclaim:     124508 kB
@@ -898,6 +899,7 @@
     AnonPages: Non-file backed pages mapped into userspace page tables
  AnonHugePages: Non-file backed huge pages mapped into userspace page tables
        Mapped: files which have been mmaped, such as libraries
+       Shmem: Total memory used by shared memory (shmem) and tmpfs
          Slab: in-kernel data structures cache
  SReclaimable: Part of Slab, that might be reclaimed, such as caches
    SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure

Documentation/filesystems/tmpfs.txt line 20

Quoted 8 lines
Documentation/filesystems/tmpfs.txt +1 -4
@@ -17,10 +17,10 @@
  cannot swap and you do not have the possibility to resize them.
 
  Since tmpfs lives completely in the page cache and on swap, all tmpfs
-pages currently in memory will show up as cached. It will not show up
-as shared or something like that. Further on you can check the actual
-RAM+swap use of a tmpfs instance with df(1) and du(1).
-
+pages will be shown in /proc/meminfo as "Shmem" and "Shared" in

It would be IMHO clearer if it said:
... will be shown as "Shmem" in /proc/meminfo and "Shared" in ...

Documentation/filesystems/tmpfs.txt line 22

Quoted 2 lines
Documentation/filesystems/tmpfs.txt +2 -0
+free(1). Notice that shared memory pages (see ipcs(1)) will be also
+counted as shared memory.

Too much of "shared memory" here. Maybe something like:
"However, these counters also include shared memory (shmem)."

Quoted 5 lines

The most reliable way to get the count is
+using df(1) and du(1).

tmpfs has the following uses:

Quoted 9 lines

---
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#4 lore raw

PATCH v2 1/1 Documentation: Describe the shared memory usage/accounting

The Shared Memory accounting support is present in Kernel since commit 4b02108ac1b3 ("mm: oom analysis: add shmem vmstat") and in userland free(1) since 2014. This patch updates the Documentation to reflect this change.

---
V2: Better wording as per Vlastimil Babka's suggestions

---
 Documentation/filesystems/proc.txt  |    2 ++
 Documentation/filesystems/tmpfs.txt |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
Documentation/filesystems/proc.txt +2 -0
index 402ab99..8ca61a0 100644
@@ -842,6 +842,7 @@ Dirty:             968 kB
 Writeback:           0 kB
 AnonPages:      861800 kB
 Mapped:         280372 kB
+Shmem:             644 kB
 Slab:           284364 kB
 SReclaimable:   159856 kB
 SUnreclaim:     124508 kB
@@ -898,6 +899,7 @@ MemAvailable: An estimate of how much memory is available for starting new
    AnonPages: Non-file backed pages mapped into userspace page tables
 AnonHugePages: Non-file backed huge pages mapped into userspace page tables
       Mapped: files which have been mmaped, such as libraries
+       Shmem: Total memory used by shared memory (shmem) and tmpfs
         Slab: in-kernel data structures cache
 SReclaimable: Part of Slab, that might be reclaimed, such as caches
   SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure
Documentation/filesystems/tmpfs.txt +4 -4
index 98ef551..d1abf2d 100644
@@ -17,10 +17,10 @@ RAM, where you have to create an ordinary filesystem on top. Ramdisks
 cannot swap and you do not have the possibility to resize them. 
 
 Since tmpfs lives completely in the page cache and on swap, all tmpfs
-pages currently in memory will show up as cached. It will not show up
-as shared or something like that. Further on you can check the actual
-RAM+swap use of a tmpfs instance with df(1) and du(1).
-
+pages will be shown as "Shmem" in /proc/meminfo and "Shared" in
+free(1). Notice that these counters also include shared memory
+(shmem, see ipcs(1)). The most reliable way to get the count is
+using df(1) and du(1).
 
 tmpfs has the following uses:
 
Signature · 1 line
1.7.1
Acked-by on v2 1/1
#5 lore raw
Quoted 7 lines · Rodrigo Freire

The Shared Memory accounting support is present in Kernel since commit 4b02108ac1b3 ("mm: oom analysis: add shmem vmstat") and in userland free(1) since 2014. This patch updates the Documentation to reflect this change.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>