Lines Matching +full:no +full:- +full:map
8 Huge pages as described at Documentation/admin-guide/mm/hugetlbpage.rst are
11 are to be used. If no huge page exists at page fault time, the task is sent
34 This is a global (per-hstate) count of reserved huge pages. Reserved
37 as (``free_huge_pages - resv_huge_pages``).
38 Reserve Map
39 A reserve map is described by the structure::
50 There is one reserve map for each huge page mapping in the system.
65 These are stored in the bottom bits of the reservation map pointer.
80 Reservation Map Location (Private or Shared)
86 semantics of the reservation map is significantly different for the two types
89 - For private mappings, the reservation map hangs off the VMA structure.
90 Specifically, vma->vm_private_data. This reserve map is created at the
92 - For shared mappings, the reservation map hangs off the inode. Specifically,
93 inode->i_mapping->private_data. Since shared mappings are always backed
95 contains a reservation map. As a result, the reservation map is allocated
112 was specified, then this routine returns immediately as no reservations
122 in which reservations are represented in the reservation map.
124 - For shared mappings, an entry in the reservation map indicates a reservation
126 consumed, the reservation map is not modified.
127 - For private mappings, the lack of an entry in the reservation map indicates
129 consumed, entries are added to the reservation map. Therefore, the
130 reservation map can also be used to determine which reservations have
133 For private mappings, hugetlb_reserve_pages() creates the reservation map and
137 The reservation map is consulted to determine how many huge page reservations
139 always the value (to - from). However, for shared mappings it is possible that
140 some reservations may already exist within the range (to - from). See the
141 section :ref:`Reservation Map Modifications <resv_map_modifications>`
149 After consulting the reservation map and subpool, the number of needed new
158 if (resv_needed <= (resv_huge_pages - free_huge_pages))
165 was adjusted, then the reservation map associated with the mapping is
167 file_region will exist that includes the range 'from' - 'to'. For private
168 mappings, no modifications are made to the reservation map as lack of an
172 reservation map associated with the mapping will be modified as required to
173 ensure reservations exist for the range 'from' - 'to'.
188 consult the reservation map to determine if a reservation exists. In addition,
197 :ref:`Reservation Map Helper Routines <resv_map_helpers>` for detailed
200 0 or 1. 0 if a reservation exists for the address, 1 if no reservation exists.
209 - avoid_reserve, this is the same value/argument passed to
211 - chg, even though this argument is of type long only the values 0 or 1 are
226 resv_huge_pages--; /* Decrement the global reservation count */
228 Note, if no huge page can be found that satisfies the VMA's memory policy
233 resv_huge_pages--.
235 After obtaining a new hugetlb folio, (folio)->_hugetlb_subpool is set to the
240 map based on the consumption of the reservation. In general, this involves
242 map. For shared mappings where the reservation was present, an entry
243 in the reserve map already existed so no change is made. However, if there
244 was no reservation in a shared mapping or this was a private mapping a new
247 It is possible that the reserve map could have been changed between the call
256 :ref:`Reservation Map Helper Routines <resv_map_helpers>` for more
267 when a huge page that has been instantiated is freed no adjustment is made
281 The page->private field points to any subpool associated with the page.
344 COW, it is possible that no free huge pages are free and the allocation
349 map of the owner. Since the owner created the mapping, the owner owns all
351 occurs and there is no page available, different action is taken for the owner
352 and non-owner of the reservation.
359 non-owning task. In this way, the only reference is from the owning task.
360 In addition, the HPAGE_RESV_UNMAPPED bit is set in the reservation map pointer
361 of the non-owning task. The non-owning task may receive a SIGBUS if it later
362 faults on a non-present page. But, the original owner of the
368 Reservation Map Modifications
372 reservation map. Typically, these routines are not called directly. Rather,
373 a reservation map helper routine is called which calls one of these low level
382 Operations on the reservation map typically involve two operations:
384 1) region_chg() is called to examine the reserve map and determine how
392 the reservation map for the same range [f, t) previously passed to
399 range. region_chg() is responsible for pre-allocating any data structures
404 which are NOT currently represented in the map. This number is returned to
406 the map. In most cases, the return value of region_add() is the same as the
408 possible for changes to the reservation map to be made between the calls to
415 The routine region_del() is called to remove regions from a reservation map.
418 - When a file in the hugetlbfs filesystem is being removed, the inode will
419 be released and the reservation map freed. Before freeing the reservation
420 map, all the individual file_region structures must be freed. In this case
422 - When a hugetlbfs file is being truncated. In this case, all allocated pages
424 in the reservation map past the new end of file must be deleted. In this
426 - When a hole is being punched in a hugetlbfs file. In this case, huge pages
429 reservation map. In this case, region_del is passed the range
433 reservation map. In VERY rare cases, region_del() can fail. This can only
436 will return -ENOMEM. The problem here is that the reservation map will
440 counters so that they correspond with the reservation map entry that could
444 private mappings, the lack of a entry in the reservation map indicates that
446 reservation map we know how many reservations were consumed and how many are
447 outstanding (outstanding = (end - start) - region_count(resv, start, end)).
453 Reservation Map Helper Routines
460 or shared) and the location of the reservation map (inode or VMA) can be
462 in the section "Reservation Map Modifications". However, they do take into
463 account the 'opposite' meaning of reservation map entries for private and
470 This routine calls region_chg() for the specified page. If no reservation
483 map was modified between calls::
501 to add a reservation to the reservation map. It takes into account the
502 different reservation map semantics for private and shared mappings. Hence,
503 region_add is called for shared mappings (as an entry present in the map
505 the absence of an entry in the map indicates a reservation). See the section
514 :ref:`Reservation Map Helper Routines <resv_map_helpers>`, reservation
515 map modifications are performed in two steps. First vma_needs_reservation
527 reservation map and global count adjustments. If the page is freed at this
529 will increment the global reservation count. However, the reservation map
532 be higher than it should and prevent allocation of a pre-allocated page.
536 the reservation map to the way it was before the page allocation. In this
537 way, the state of the reservation map will correspond to the global reservation
541 attempting to restore the reservation map entry. In this case, it will
544 reservation map will continue to look as though the reservation was consumed.
555 Per-node huge page lists existed in struct hstate when git was first used
557 When reservations were added, no attempt was made to take memory policy
582 of cpusets or memory policy there is no guarantee that huge pages will be
594 --