Lines Matching refs:to

24 factor will affect all subsequent accesses to the memory for the whole
34 miss is going to run faster.
39 hugepage knowledge fall back to breaking a transparent hugepage and
55 to avoid unmovable pages to fragment all the memory but such a tweak
56 is not specific to transparent hugepage support and it's a generic
57 feature that applies to all dynamic high order allocations in the
61 regions but it'd be ideal to move it to tmpfs and the pagecache
65 if compared to the reservation approach of hugetlbfs by allowing all
66 unused memory to be used as cache or other movable (or even unmovable
67 entities). It doesn't require reservation to prevent hugepage
68 allocation failures to be noticeable from userland. It allows paging
69 and all other advanced VM features to be available on the
70 hugepages. It requires no modifications for applications to take
73 Applications however can be further optimized to take advantage of
74 this feature, like for example they've been optimized before to avoid
84 possible to disable hugepages system-wide and to only have them inside
88 to eliminate any risk of wasting any precious byte of memory and to
92 risk to lose memory by using hugepages, should use
98 debugging purposes) or only enabled inside MADV_HUGEPAGE regions (to
106 It's also possible to limit defrag efforts in the VM to generate
107 hugepages in case they're not immediately free to madvise regions or
108 to never try to defrag memory and simply fallback to regular pages
110 time to defrag memory, we would expect to gain even more by the fact
119 By default kernel tries to use huge zero page on read page fault.
120 It's possible to disable huge zero page by writing 0 or enable it
127 transparent_hugepage/enabled is set to "always" or "madvise, and it'll
128 be automatically shutdown if it's set to "never".
130 khugepaged runs usually at low frequency so while one may not want to
133 also possible to disable defrag in khugepaged by writing 0 or enable
144 and how many milliseconds to wait in khugepaged between each pass (you
145 can set this to 0 to run khugepaged at 100% utilization of one core):
149 and how many milliseconds to wait in khugepaged if there's an hugepage
150 allocation failure to throttle the next allocation attempt.
168 A higher value leads to use additional memory for programs.
169 A lower value leads to gain less thp performance. Value of
188 (without "") to the kernel command line.
193 behavior. So to make them effective you need to restart any
194 application that could have been using hugepages. This also applies to
202 necessary to read /proc/PID/smaps and count the AnonHugePages fields
206 There are a number of counters in /proc/vmstat that may be used to
210 allocated to handle a page fault. This applies to both the
214 a range of pages to collapse into one huge page and has
215 successfully allocated a new huge page to store the data.
217 thp_fault_fallback is incremented if a page fault fails to allocate
218 a huge page and instead falls back to using small pages.
233 thp_zero_page_alloc_failed is incremented if kernel fails to allocate
234 huge zero page and falls back to using small pages.
237 system uses memory compaction to copy data around memory to free a
238 huge page for use. There are some counters in /proc/vmstat to help
241 compact_stall is incremented every time a process stalls to run
247 compact_fail is incremented if the system tries to compact memory
252 is copying a lot of data to satisfy the huge page allocation.
262 It is possible to establish how long the stalls were using the function
263 tracer to record how long was spent in __alloc_pages_nodemask and
264 using the mm_page_alloc tracepoint to identify which allocations were
272 address of the page and its temporary pinning to release after the I/O
274 if any driver is going to mangle over the page structure of the tail
276 for the head page and not the tail page), it should be updated to jump
277 to check head page instead (while serializing properly against
278 split_huge_page() to avoid the head and tail pages to disappear from
279 under it, see the futex code to see an example of that, hugetlbfs also
282 NOTE: these aren't new constraints to the GUP API, and they match the
283 same constrains that applies to hugetlbfs too, so any driver capable
288 follow_page, the FOLL_SPLIT bit can be specified as parameter to
290 them. Migration for example passes FOLL_SPLIT as parameter to
293 hugepages thanks to FOLL_SPLIT). migration simply can't deal with
295 page and pinning it during the copy but it pretends to migrate the
301 memory region, the mmap region has to be hugepage naturally
309 usual features belonging to hugetlbfs are preserved and
316 pmd_offset. It's trivial to make the code transparent hugepage aware
318 missing after pmd_offset returns the pmd. Thanks to the graceful
319 fallback design, with a one liner change, you can avoid to write
320 hundred if not thousand of lines of complex code to make your code
326 it tries to swapout the hugepage for example.
328 Example to make mremap.c transparent hugepage aware with a one liner
347 To make pagetable walks huge pmd aware, all you need to do is to call
349 mmap_sem in read (or write) mode to be sure an huge pmd cannot be
351 takes the mmap_sem in write mode in addition to the anon_vma lock). If
353 paths. If instead pmd_trans_huge returns true, you have to take the
355 page_table_lock will prevent the huge pmd to be converted into a
356 regular pmd from under you (split_huge_page can run in parallel to the
358 should just drop the page_table_lock and fallback to the old code as
362 returns true it's enough to drop the page_table_lock and call
365 huge anymore. If pmd_trans_splitting returns false, you can proceed to
371 split_huge_page internally has to distribute the refcounts in the head
372 page to the tail pages before clearing all PG_head/tail bits from the
376 hugepage), requires the refcount to be accounted on the tail pages and
377 not only in the head pages, if we want to be able to run
379 page. Failure to be able to run split_huge_page if there's any gup pin
380 on any tail page, would mean having to split all hugepages upfront in
388 split_huge_page. But we still have to add the gup pin to the head page
389 too, to know when we can free the compound page in case it's never
393 and then it will decrease the head page refcount in addition to the
394 tail page refcount. To obtain a head page reliably and to decrease its
395 refcount without race conditions, put_page has to serialize against