Skip to contentSkip to conversation

docs: update THP admin guide about non-tmpfs filesystem support

PATCH Superseded Pankaj Raghav (Samsung) 3 participants 4 messages Apr 3, 2025

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: update THP admin guide about non-tmpfs filesystem support

From: Pankaj Raghav <[email protected]>

THP support for non-tmpfs filesystem has been around for some time now. Update the admin guide to reflect it.

---
 Documentation/admin-guide/mm/transhuge.rst | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Documentation/admin-guide/mm/transhuge.rst +6 -2
index dff8d5985f0f..01b7ce90d693 100644
@@ -12,8 +12,8 @@ using huge pages for the backing of virtual memory with huge pages
 that supports the automatic promotion and demotion of page sizes and
 without the shortcomings of hugetlbfs.
 
-Currently THP only works for anonymous memory mappings and tmpfs/shmem.
-But in the future it can expand to other filesystems.
+Currently, THP only works for anonymous memory mappings, tmpfs/shmem and
+filesystems that support large folios.
 
 .. note::
    in the examples below we presume that the basic page size is 4K and
@@ -463,6 +463,10 @@ fields for each mapping. (Note that AnonHugePages only applies to traditional
 PMD-sized THP for historical reasons and should have been called
 AnonHugePmdMapped).
 
+The number of PMD-sized transparent huge pages currently used by
+filesystem data (page cache) is available by reading the FileHugePages field
+in ``/proc/meminfo``.
+
 The number of file transparent huge pages mapped to userspace is available
 by reading ShmemPmdMapped and ShmemHugePages fields in ``/proc/meminfo``.
 To identify what applications are mapping file transparent huge pages, it

base-commit: f0a16f5363325cc8d9382471cdc7b654c53254c9

Signature · 1 line
2.44.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Pankaj Raghav (Samsung)
Documentation/admin-guide/mm/transhuge.rst +6 -2
index dff8d5985f0f..01b7ce90d693 100644
@@ -12,8 +12,8 @@ using huge pages for the backing of virtual memory with huge pages
 that supports the automatic promotion and demotion of page sizes and
 without the shortcomings of hugetlbfs.
 
-Currently THP only works for anonymous memory mappings and tmpfs/shmem.
-But in the future it can expand to other filesystems.
+Currently, THP only works for anonymous memory mappings, tmpfs/shmem and
+filesystems that support large folios.
 
 .. note::
    in the examples below we presume that the basic page size is 4K and
@@ -463,6 +463,10 @@ fields for each mapping. (Note that AnonHugePages only applies to traditional
 PMD-sized THP for historical reasons and should have been called
 AnonHugePmdMapped).
 
+The number of PMD-sized transparent huge pages currently used by
+filesystem data (page cache) is available by reading the FileHugePages field
+in ``/proc/meminfo``.
+
 The number of file transparent huge pages mapped to userspace is available
 by reading ShmemPmdMapped and ShmemHugePages fields in ``/proc/meminfo``.
 To identify what applications are mapping file transparent huge pages, it
Quoted 1 line

base-commit: f0a16f5363325cc8d9382471cdc7b654c53254c9

The wording looks good, thanks!

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#2 lore raw
In reply to Pankaj Raghav (Samsung)
Quoted 26 lines · Pankaj Raghav (Samsung)

From: Pankaj Raghav <[email protected]>

THP support for non-tmpfs filesystem has been around for some time now. Update the admin guide to reflect it.

---
  Documentation/admin-guide/mm/transhuge.rst | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
Documentation/admin-guide/mm/transhuge.rst +2 -2
index dff8d5985f0f..01b7ce90d693 100644
@@ -12,8 +12,8 @@ using huge pages for the backing of virtual memory with huge pages
  that supports the automatic promotion and demotion of page sizes and
  without the shortcomings of hugetlbfs.
 
-Currently THP only works for anonymous memory mappings and tmpfs/shmem.
-But in the future it can expand to other filesystems.
+Currently, THP only works for anonymous memory mappings, tmpfs/shmem and
+filesystems that support large folios.
 
  .. note::
     in the examples below we presume that the basic page size is 4K and

Documentation/admin-guide/mm/transhuge.rst fields for each mapping. (Note that AnonHugePages only applies to traditional · line 469

Quoted 7 lines
Documentation/admin-guide/mm/transhuge.rst +4 -0
@@ -463,6 +463,10 @@ fields for each mapping. (Note that AnonHugePages only applies to traditional
  PMD-sized THP for historical reasons and should have been called
  AnonHugePmdMapped).
 
+The number of PMD-sized transparent huge pages currently used by
+filesystem data (page cache) is available by reading the FileHugePages field
+in ``/proc/meminfo``.
+

These changed look good. Do we also want to talk about FilePmdMapped? (PMD-sized THPs in the page cache that are mapped in to user space using a PMD ?)

Do we have to distinguish it from below? (shmem also uses the page cache)

Documentation/admin-guide/mm/transhuge.rst fields for each mapping. (Note that AnonHugePages only applies to traditional · line 472

Quoted 3 lines
Documentation/admin-guide/mm/transhuge.rst +0 -0
  The number of file transparent huge pages mapped to userspace is available
  by reading ShmemPmdMapped and ShmemHugePages fields in ``/proc/meminfo``.
  To identify what applications are mapping file transparent huge pages, it

Previously here, but: this reads rather odd. "file transparent huge pages". "PMD-sized THPs specific to shmem are tracked separately ..." ?

Signature · 3 lines
Cheers,

David / dhildenb
#3 lore raw
Quoted 4 lines
Quoted 4 lines

in the examples below we presume that the basic page size is 4K and

Documentation/admin-guide/mm/transhuge.rst +0 -0
@@ -463,6 +463,10 @@ fields for each mapping. (Note that AnonHugePages only applies to traditional
  PMD-sized THP for historical reasons and should have been called
  AnonHugePmdMapped).
Quoted 8 lines

Documentation/admin-guide/mm/transhuge.rst fields for each mapping. (Note that AnonHugePages only applies to traditional · line 469

Quoted 4 lines
Documentation/admin-guide/mm/transhuge.rst +4 -0
+The number of PMD-sized transparent huge pages currently used by
+filesystem data (page cache) is available by reading the FileHugePages field
+in ``/proc/meminfo``.
+

These changed look good. Do we also want to talk about FilePmdMapped? (PMD-sized THPs in the page cache that are mapped in to user space using a PMD ?)

I am a bit new to this subsystem, and it took some time to wrap around all the different terminology used :)

But sure, I will add a new commit to talk about FilePmdMapped. I can give it a shot with what I understand about FilePmdMapped, but please feel free to add your input.

Quoted 10 lines

Do we have to distinguish it from below? (shmem also uses the page cache)

Documentation/admin-guide/mm/transhuge.rst fields for each mapping. (Note that AnonHugePages only applies to traditional · line 472

Quoted 3 lines
Documentation/admin-guide/mm/transhuge.rst +0 -0
  The number of file transparent huge pages mapped to userspace is available
  by reading ShmemPmdMapped and ShmemHugePages fields in ``/proc/meminfo``.
  To identify what applications are mapping file transparent huge pages, it

Previously here, but: this reads rather odd. "file transparent huge pages". "PMD-sized THPs specific to shmem are tracked separately ..." ?

I totally agree. Reading "file transparent huge pages" confused me even more. I will fold these changes as well.

Thanks, David.

--
Pankaj