Skip to contentSkip to conversation

tools: modifying page-types to include shared map counts

PATCH New Christian Hansen 1 participant 1 message Jul 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: modifying page-types to include shared map counts

Adding a new flag that will read kpagecount for each PFN and print out the number of times the page is mapped along with the flags in the listing view.

This information is useful in understanding and optimizing memory usage. Identifying pages which are not shared allows us to focus on adjusting the memory layout or access patterns for the sole owning process. Knowing the number of processes that share a page tells us how many other times we must make the same adjustments or how many processes to potentially disable.

Truncated sample output:

voffset map-cnt offset  len     flags
561a3591e       1       15fe8   1       ___U_lA____Ma_b___________________________
561a3591f       1       2b103   1       ___U_lA____Ma_b___________________________
561a36ca4       1       2cc78   1       ___U_lA____Ma_b___________________________
7f588bb4e       14      2273c   1       __RU_lA____M______________________________
---
 Documentation/admin-guide/mm/pagemap.rst |  3 ++
 tools/vm/page-types.c                    | 73 ++++++++++++++++++++++++++------
 2 files changed, 62 insertions(+), 14 deletions(-)
Documentation/admin-guide/mm/pagemap.rst +3 -0
index 577af85..3f7bade 100644
@@ -44,6 +44,9 @@ There are four components to pagemap:
  * ``/proc/kpagecount``.  This file contains a 64-bit count of the number of
    times each page is mapped, indexed by PFN.
 
+The page-types tool in the tools/vm directory can be used to query the
+number of times a page is mapped.
+
  * ``/proc/kpageflags``.  This file contains a 64-bit set of flags for each
    page, indexed by PFN.
 
tools/vm/page-types.c +59 -14

228 lines not on this page · raw message

Signature · 1 line
2.10.3.dirty