diff options
| author | Mel Gorman <mgorman@suse.de> | 2012-05-29 18:06:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:23 -0400 |
| commit | 692569946fbf56fbb75d85c57679541f9a3550b4 (patch) | |
| tree | 74e8dbcec28756ef92a9782b7e17311c47b72597 /Documentation/vm | |
| parent | 51300cef41c9355a7d428fe0714888d3c72a6f2f (diff) | |
mm: document the meminfo and vmstat fields of relevance to transparent hugepages
Update Documentation/vm/transhuge.txt and
Documentation/filesystems/proc.txt with some information on monitoring
transparent huge page usage and the associated overhead.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/vm')
| -rw-r--r-- | Documentation/vm/transhuge.txt | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt index 29bdf62aac0..f734bb2a78d 100644 --- a/Documentation/vm/transhuge.txt +++ b/Documentation/vm/transhuge.txt | |||
| @@ -166,6 +166,68 @@ behavior. So to make them effective you need to restart any | |||
| 166 | application that could have been using hugepages. This also applies to | 166 | application that could have been using hugepages. This also applies to |
| 167 | the regions registered in khugepaged. | 167 | the regions registered in khugepaged. |
| 168 | 168 | ||
| 169 | == Monitoring usage == | ||
| 170 | |||
| 171 | The number of transparent huge pages currently used by the system is | ||
| 172 | available by reading the AnonHugePages field in /proc/meminfo. To | ||
| 173 | identify what applications are using transparent huge pages, it is | ||
| 174 | necessary to read /proc/PID/smaps and count the AnonHugePages fields | ||
| 175 | for each mapping. Note that reading the smaps file is expensive and | ||
| 176 | reading it frequently will incur overhead. | ||
| 177 | |||
| 178 | There are a number of counters in /proc/vmstat that may be used to | ||
| 179 | monitor how successfully the system is providing huge pages for use. | ||
| 180 | |||
| 181 | thp_fault_alloc is incremented every time a huge page is successfully | ||
| 182 | allocated to handle a page fault. This applies to both the | ||
| 183 | first time a page is faulted and for COW faults. | ||
| 184 | |||
| 185 | thp_collapse_alloc is incremented by khugepaged when it has found | ||
| 186 | a range of pages to collapse into one huge page and has | ||
| 187 | successfully allocated a new huge page to store the data. | ||
| 188 | |||
| 189 | thp_fault_fallback is incremented if a page fault fails to allocate | ||
| 190 | a huge page and instead falls back to using small pages. | ||
| 191 | |||
| 192 | thp_collapse_alloc_failed is incremented if khugepaged found a range | ||
| 193 | of pages that should be collapsed into one huge page but failed | ||
| 194 | the allocation. | ||
| 195 | |||
| 196 | thp_split is incremented every time a huge page is split into base | ||
| 197 | pages. This can happen for a variety of reasons but a common | ||
| 198 | reason is that a huge page is old and is being reclaimed. | ||
| 199 | |||
| 200 | As the system ages, allocating huge pages may be expensive as the | ||
| 201 | system uses memory compaction to copy data around memory to free a | ||
| 202 | huge page for use. There are some counters in /proc/vmstat to help | ||
| 203 | monitor this overhead. | ||
| 204 | |||
| 205 | compact_stall is incremented every time a process stalls to run | ||
| 206 | memory compaction so that a huge page is free for use. | ||
| 207 | |||
| 208 | compact_success is incremented if the system compacted memory and | ||
| 209 | freed a huge page for use. | ||
| 210 | |||
| 211 | compact_fail is incremented if the system tries to compact memory | ||
| 212 | but failed. | ||
| 213 | |||
| 214 | compact_pages_moved is incremented each time a page is moved. If | ||
| 215 | this value is increasing rapidly, it implies that the system | ||
| 216 | is copying a lot of data to satisfy the huge page allocation. | ||
| 217 | It is possible that the cost of copying exceeds any savings | ||
| 218 | from reduced TLB misses. | ||
| 219 | |||
| 220 | compact_pagemigrate_failed is incremented when the underlying mechanism | ||
| 221 | for moving a page failed. | ||
| 222 | |||
| 223 | compact_blocks_moved is incremented each time memory compaction examines | ||
| 224 | a huge page aligned range of pages. | ||
| 225 | |||
| 226 | It is possible to establish how long the stalls were using the function | ||
| 227 | tracer to record how long was spent in __alloc_pages_nodemask and | ||
| 228 | using the mm_page_alloc tracepoint to identify which allocations were | ||
| 229 | for huge pages. | ||
| 230 | |||
| 169 | == get_user_pages and follow_page == | 231 | == get_user_pages and follow_page == |
| 170 | 232 | ||
| 171 | get_user_pages and follow_page if run on a hugepage, will return the | 233 | get_user_pages and follow_page if run on a hugepage, will return the |
