linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] update thp admin doc
@ 2025-04-04 10:01 Pankaj Raghav (Samsung)
  2025-04-04 10:01 ` [PATCH v2 1/2] docs: update THP admin guide about non-tmpfs filesystem support Pankaj Raghav (Samsung)
  2025-04-04 10:01 ` [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage Pankaj Raghav (Samsung)
  0 siblings, 2 replies; 5+ messages in thread
From: Pankaj Raghav (Samsung) @ 2025-04-04 10:01 UTC (permalink / raw)
  To: Andrew Morton, Jonathan Corbet
  Cc: linux-kernel, linux-mm, willy, David Hildenbrand, Bagas Sanjaya,
	da.gomez, mcgrof, gost.dev, linux-doc, kernel, Pankaj Raghav

From: Pankaj Raghav <p.raghav@samsung.com>

Update the THP admin doc about non-tmpfs filesystem support and clarify
certain variables for clarity.

Changes since v1:
- Added RVB from Bagas Sanjaya
- Expanded on ShmemHugePage, ShmemPmdMapped and FilePmdMapped based on
  the feedback from David

Pankaj Raghav (2):
  docs: update THP admin guide about non-tmpfs filesystem support
  docs: clarify THP admin guide about (File|Shmem)PmdMapped and
    ShmemHugePage

 Documentation/admin-guide/mm/transhuge.rst | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)


base-commit: f0a16f5363325cc8d9382471cdc7b654c53254c9
-- 
2.47.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] docs: update THP admin guide about non-tmpfs filesystem support
  2025-04-04 10:01 [PATCH v2 0/2] update thp admin doc Pankaj Raghav (Samsung)
@ 2025-04-04 10:01 ` Pankaj Raghav (Samsung)
  2025-04-04 10:01 ` [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage Pankaj Raghav (Samsung)
  1 sibling, 0 replies; 5+ messages in thread
From: Pankaj Raghav (Samsung) @ 2025-04-04 10:01 UTC (permalink / raw)
  To: Andrew Morton, Jonathan Corbet
  Cc: linux-kernel, linux-mm, willy, David Hildenbrand, Bagas Sanjaya,
	da.gomez, mcgrof, gost.dev, linux-doc, kernel, Pankaj Raghav

From: Pankaj Raghav <p.raghav@samsung.com>

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

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
 Documentation/admin-guide/mm/transhuge.rst | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst
index dff8d5985f0f..01b7ce90d693 100644
--- a/Documentation/admin-guide/mm/transhuge.rst
+++ b/Documentation/admin-guide/mm/transhuge.rst
@@ -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
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage
  2025-04-04 10:01 [PATCH v2 0/2] update thp admin doc Pankaj Raghav (Samsung)
  2025-04-04 10:01 ` [PATCH v2 1/2] docs: update THP admin guide about non-tmpfs filesystem support Pankaj Raghav (Samsung)
@ 2025-04-04 10:01 ` Pankaj Raghav (Samsung)
  2025-04-04 12:44   ` Bagas Sanjaya
  2025-04-04 12:55   ` David Hildenbrand
  1 sibling, 2 replies; 5+ messages in thread
From: Pankaj Raghav (Samsung) @ 2025-04-04 10:01 UTC (permalink / raw)
  To: Andrew Morton, Jonathan Corbet
  Cc: linux-kernel, linux-mm, willy, David Hildenbrand, Bagas Sanjaya,
	da.gomez, mcgrof, gost.dev, linux-doc, kernel, Pankaj Raghav

From: Pankaj Raghav <p.raghav@samsung.com>

Move FilePmdMapped to previous paragraph for clarity, and clarify
ShmemPmdMapped & ShmemHugePage.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 Documentation/admin-guide/mm/transhuge.rst | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst
index 01b7ce90d693..b0b9d578732b 100644
--- a/Documentation/admin-guide/mm/transhuge.rst
+++ b/Documentation/admin-guide/mm/transhuge.rst
@@ -465,13 +465,17 @@ 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``.
+in ``/proc/meminfo``. The number of these huge pages that are mapped to userspace
+is available by reading FilePmdMapped field in ``proc/meminfo``. To identify
+what applications are mapping these huge pages, it is necessary to read
+``/proc/PID/smaps`` and count the FilePmdMapped fields for each mapping.
 
-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
-is necessary to read ``/proc/PID/smaps`` and count the FilePmdMapped fields
-for each mapping.
+The number of PMD-sized transparent huge pages currently used by
+tmpfs/shmem is available by reading the ShmemHugePages field
+in ``/proc/meminfo``. The number of these huge pages that are mapped to userspace
+is available by reading ShmemPmdMapped field in ``proc/meminfo``. To identify
+what applications are mapping these huge pages, it is necessary to read
+``/proc/PID/smaps`` and count the ShmemPmdMapped fields for each mapping.
 
 Note that reading the smaps file is expensive and reading it
 frequently will incur overhead.
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage
  2025-04-04 10:01 ` [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage Pankaj Raghav (Samsung)
@ 2025-04-04 12:44   ` Bagas Sanjaya
  2025-04-04 12:55   ` David Hildenbrand
  1 sibling, 0 replies; 5+ messages in thread
From: Bagas Sanjaya @ 2025-04-04 12:44 UTC (permalink / raw)
  To: Pankaj Raghav (Samsung), Andrew Morton, Jonathan Corbet
  Cc: linux-kernel, linux-mm, willy, David Hildenbrand, da.gomez,
	mcgrof, gost.dev, linux-doc, Pankaj Raghav

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Fri, Apr 04, 2025 at 12:01:59PM +0200, Pankaj Raghav (Samsung) wrote:
> -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
> -is necessary to read ``/proc/PID/smaps`` and count the FilePmdMapped fields
> -for each mapping.
> +The number of PMD-sized transparent huge pages currently used by
"In similar fashion, the number ..."
> +tmpfs/shmem is available by reading the ShmemHugePages field
> +in ``/proc/meminfo``. The number of these huge pages that are mapped to userspace
> +is available by reading ShmemPmdMapped field in ``proc/meminfo``. To identify
> +what applications are mapping these huge pages, it is necessary to read
> +``/proc/PID/smaps`` and count the ShmemPmdMapped fields for each mapping.
>  

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage
  2025-04-04 10:01 ` [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage Pankaj Raghav (Samsung)
  2025-04-04 12:44   ` Bagas Sanjaya
@ 2025-04-04 12:55   ` David Hildenbrand
  1 sibling, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2025-04-04 12:55 UTC (permalink / raw)
  To: Pankaj Raghav (Samsung), Andrew Morton, Jonathan Corbet
  Cc: linux-kernel, linux-mm, willy, Bagas Sanjaya, da.gomez, mcgrof,
	gost.dev, linux-doc, Pankaj Raghav

On 04.04.25 12:01, Pankaj Raghav (Samsung) wrote:
> From: Pankaj Raghav <p.raghav@samsung.com>
> 
> Move FilePmdMapped to previous paragraph for clarity, and clarify
> ShmemPmdMapped & ShmemHugePage.
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>   Documentation/admin-guide/mm/transhuge.rst | 16 ++++++++++------
>   1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst
> index 01b7ce90d693..b0b9d578732b 100644
> --- a/Documentation/admin-guide/mm/transhuge.rst
> +++ b/Documentation/admin-guide/mm/transhuge.rst
> @@ -465,13 +465,17 @@ 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``.
> +in ``/proc/meminfo``. The number of these huge pages that are mapped to userspace
> +is available by reading FilePmdMapped field in ``proc/meminfo``. To identify
> +what applications are mapping these huge pages, it is necessary to read
> +``/proc/PID/smaps`` and count the FilePmdMapped fields for each mapping.
>   

Having that change here looks weird.

I suggest to just squash both patches, they are intertwined.

> -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
> -is necessary to read ``/proc/PID/smaps`` and count the FilePmdMapped fields
> -for each mapping.
> +The number of PMD-sized transparent huge pages currently used by
> +tmpfs/shmem is available by reading the ShmemHugePages field
> +in ``/proc/meminfo``. The number of these huge pages that are mapped to userspace
> +is available by reading ShmemPmdMapped field in ``proc/meminfo``. To identify
> +what applications are mapping these huge pages, it is necessary to read
> +``/proc/PID/smaps`` and count the ShmemPmdMapped fields for each mapping.

Apart from that (and taking Bagas comment in account), LGTM.

Feel free to add

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-04 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04 10:01 [PATCH v2 0/2] update thp admin doc Pankaj Raghav (Samsung)
2025-04-04 10:01 ` [PATCH v2 1/2] docs: update THP admin guide about non-tmpfs filesystem support Pankaj Raghav (Samsung)
2025-04-04 10:01 ` [PATCH v2 2/2] docs: clarify THP admin guide about (File|Shmem)PmdMapped and ShmemHugePage Pankaj Raghav (Samsung)
2025-04-04 12:44   ` Bagas Sanjaya
2025-04-04 12:55   ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).