linux/Documentation/vm
Roman Gushchin fcb2b0c577 mm: show total hugetlb memory consumption in /proc/meminfo
Currently we display some hugepage statistics (total, free, etc) in
/proc/meminfo, but only for default hugepage size (e.g.  2Mb).

If hugepages of different sizes are used (like 2Mb and 1Gb on x86-64),
/proc/meminfo output can be confusing, as non-default sized hugepages
are not reflected at all, and there are no signs that they are existing
and consuming system memory.

To solve this problem, let's display the total amount of memory,
consumed by hugetlb pages of all sized (both free and used).  Let's call
it "Hugetlb", and display size in kB to match generic /proc/meminfo
style.

For example, (1024 2Mb pages and 2 1Gb pages are pre-allocated):
  $ cat /proc/meminfo
  MemTotal:        8168984 kB
  MemFree:         3789276 kB
  <...>
  CmaFree:               0 kB
  HugePages_Total:    1024
  HugePages_Free:     1024
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  Hugepagesize:       2048 kB
  Hugetlb:         4194304 kB
  DirectMap4k:       32632 kB
  DirectMap2M:     4161536 kB
  DirectMap1G:     6291456 kB

Also, this patch updates corresponding docs to reflect Hugetlb entry
meaning and difference between Hugetlb and HugePages_Total * Hugepagesize.

Link: http://lkml.kernel.org/r/20171115231409.12131-1-guro@fb.com
Signed-off-by: Roman Gushchin <guro@fb.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-01-31 17:18:36 -08:00
..
.gitignore
00-INDEX Documentation: vm, add hugetlbfs reservation overview 2017-05-03 15:52:11 -07:00
active_mm.txt
balance
cleancache.txt
frontswap.txt
highmem.txt
hmm.txt hmm: heterogeneous memory management documentation 2017-09-08 18:26:45 -07:00
hugetlbfs_reserv.txt Documentation: vm, add hugetlbfs reservation overview 2017-05-03 15:52:11 -07:00
hugetlbpage.txt mm: show total hugetlb memory consumption in /proc/meminfo 2018-01-31 17:18:36 -08:00
hwpoison.txt
idle_page_tracking.txt
ksm.txt ksm: introduce ksm_max_page_sharing per page deduplication limit 2017-07-06 16:24:31 -07:00
mmu_notifier.txt mm/mmu_notifier: avoid double notification when it is useless 2017-11-15 18:21:03 -08:00
numa mm, page_alloc: rip out ZONELIST_ORDER_ZONE 2017-09-06 17:27:25 -07:00
numa_memory_policy.txt Documenation: update cgroup's document path 2016-08-03 15:43:58 -06:00
overcommit-accounting
page_frags mm: add documentation for page fragment APIs 2017-01-10 18:31:55 -08:00
page_migration Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
page_owner.txt mm, page_owner: convert page_owner_inited to static key 2016-03-15 16:55:16 -07:00
pagemap.txt Documentation typo: wrong page flag bit for KPF_HUGE 2016-04-15 15:47:10 -06:00
remap_file_pages.txt
slub.txt slub: convert SLAB_DEBUG_FREE to SLAB_CONSISTENCY_CHECKS 2016-03-15 16:55:16 -07:00
soft-dirty.txt
split_page_table_lock
swap_numa.txt swap: choose swap device according to numa node 2017-09-06 17:27:30 -07:00
transhuge.txt Documentation/vm/transhuge.txt: fix trivial typos 2017-05-08 17:15:14 -07:00
unevictable-lru.txt Three fixes for the docs build, including removing an annoying warning on 2016-08-07 10:23:17 -04:00
userfaultfd.txt userfaultfd: non-cooperative: rollback userfaultfd_exit 2017-03-09 17:01:09 -08:00
z3fold.txt z3fold: the 3-fold allocator for compressed pages 2016-05-20 17:58:30 -07:00
zsmalloc.txt
zswap.txt Documentation/vm/zswap.txt: update with same-value filled page feature 2017-12-14 16:00:48 -08:00