aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/vm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 16:11:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 16:11:15 -0500
commitf6e858a00af788bab0fd4c0b7f5cd788000edc18 (patch)
treef9403ca3671be9821dbf83e726e61dbe75fbca6b /Documentation/vm
parent193c0d682525987db59ac3a24531a77e4947aa95 (diff)
parent98870901cce098bbe94d90d2c41d8d1fa8d94392 (diff)
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc VM changes from Andrew Morton: "The rest of most-of-MM. The other MM bits await a slab merge. This patch includes the addition of a huge zero_page. Not a performance boost but it an save large amounts of physical memory in some situations. Also a bunch of Fujitsu engineers are working on memory hotplug. Which, as it turns out, was badly broken. About half of their patches are included here; the remainder are 3.8 material." However, this merge disables CONFIG_MOVABLE_NODE, which was totally broken. We don't add new features with "default y", nor do we add Kconfig questions that are incomprehensible to most people without any help text. Does the feature even make sense without compaction or memory hotplug? * akpm: (54 commits) mm/bootmem.c: remove unused wrapper function reserve_bootmem_generic() mm/memory.c: remove unused code from do_wp_page() asm-generic, mm: pgtable: consolidate zero page helpers mm/hugetlb.c: fix warning on freeing hwpoisoned hugepage hwpoison, hugetlbfs: fix RSS-counter warning hwpoison, hugetlbfs: fix "bad pmd" warning in unmapping hwpoisoned hugepage mm: protect against concurrent vma expansion memcg: do not check for mm in __mem_cgroup_count_vm_event tmpfs: support SEEK_DATA and SEEK_HOLE (reprise) mm: provide more accurate estimation of pages occupied by memmap fs/buffer.c: remove redundant initialization in alloc_page_buffers() fs/buffer.c: do not inline exported function writeback: fix a typo in comment mm: introduce new field "managed_pages" to struct zone mm, oom: remove statically defined arch functions of same name mm, oom: remove redundant sleep in pagefault oom handler mm, oom: cleanup pagefault oom handler memory_hotplug: allow online/offline memory to result movable node numa: add CONFIG_MOVABLE_NODE for movable-dedicated node mm, memcg: avoid unnecessary function call when memcg is disabled ...
Diffstat (limited to 'Documentation/vm')
-rw-r--r--Documentation/vm/transhuge.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt
index f734bb2a78d..8785fb87d9c 100644
--- a/Documentation/vm/transhuge.txt
+++ b/Documentation/vm/transhuge.txt
@@ -116,6 +116,13 @@ echo always >/sys/kernel/mm/transparent_hugepage/defrag
116echo madvise >/sys/kernel/mm/transparent_hugepage/defrag 116echo madvise >/sys/kernel/mm/transparent_hugepage/defrag
117echo never >/sys/kernel/mm/transparent_hugepage/defrag 117echo never >/sys/kernel/mm/transparent_hugepage/defrag
118 118
119By default kernel tries to use huge zero page on read page fault.
120It's possible to disable huge zero page by writing 0 or enable it
121back by writing 1:
122
123echo 0 >/sys/kernel/mm/transparent_hugepage/khugepaged/use_zero_page
124echo 1 >/sys/kernel/mm/transparent_hugepage/khugepaged/use_zero_page
125
119khugepaged will be automatically started when 126khugepaged will be automatically started when
120transparent_hugepage/enabled is set to "always" or "madvise, and it'll 127transparent_hugepage/enabled is set to "always" or "madvise, and it'll
121be automatically shutdown if it's set to "never". 128be automatically shutdown if it's set to "never".
@@ -197,6 +204,14 @@ 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 204 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. 205 reason is that a huge page is old and is being reclaimed.
199 206
207thp_zero_page_alloc is incremented every time a huge zero page is
208 successfully allocated. It includes allocations which where
209 dropped due race with other allocation. Note, it doesn't count
210 every map of the huge zero page, only its allocation.
211
212thp_zero_page_alloc_failed is incremented if kernel fails to allocate
213 huge zero page and falls back to using small pages.
214
200As the system ages, allocating huge pages may be expensive as the 215As the system ages, allocating huge pages may be expensive as the
201system uses memory compaction to copy data around memory to free a 216system uses memory compaction to copy data around memory to free a
202huge page for use. There are some counters in /proc/vmstat to help 217huge page for use. There are some counters in /proc/vmstat to help
@@ -276,7 +291,7 @@ unaffected. libhugetlbfs will also work fine as usual.
276== Graceful fallback == 291== Graceful fallback ==
277 292
278Code walking pagetables but unware about huge pmds can simply call 293Code walking pagetables but unware about huge pmds can simply call
279split_huge_page_pmd(mm, pmd) where the pmd is the one returned by 294split_huge_page_pmd(vma, addr, pmd) where the pmd is the one returned by
280pmd_offset. It's trivial to make the code transparent hugepage aware 295pmd_offset. It's trivial to make the code transparent hugepage aware
281by just grepping for "pmd_offset" and adding split_huge_page_pmd where 296by just grepping for "pmd_offset" and adding split_huge_page_pmd where
282missing after pmd_offset returns the pmd. Thanks to the graceful 297missing after pmd_offset returns the pmd. Thanks to the graceful
@@ -299,7 +314,7 @@ diff --git a/mm/mremap.c b/mm/mremap.c
299 return NULL; 314 return NULL;
300 315
301 pmd = pmd_offset(pud, addr); 316 pmd = pmd_offset(pud, addr);
302+ split_huge_page_pmd(mm, pmd); 317+ split_huge_page_pmd(vma, addr, pmd);
303 if (pmd_none_or_clear_bad(pmd)) 318 if (pmd_none_or_clear_bad(pmd))
304 return NULL; 319 return NULL;
305 320