.. | .. |
---|
85 | 85 | A huge page mapping or segment is either private or shared. If private, |
---|
86 | 86 | it is typically only available to a single address space (task). If shared, |
---|
87 | 87 | it can be mapped into multiple address spaces (tasks). The location and |
---|
88 | | -semantics of the reservation map is significantly different for two types |
---|
| 88 | +semantics of the reservation map is significantly different for the two types |
---|
89 | 89 | of mappings. Location differences are: |
---|
90 | 90 | |
---|
91 | | -- For private mappings, the reservation map hangs off the the VMA structure. |
---|
| 91 | +- For private mappings, the reservation map hangs off the VMA structure. |
---|
92 | 92 | Specifically, vma->vm_private_data. This reserve map is created at the |
---|
93 | 93 | time the mapping (mmap(MAP_PRIVATE)) is created. |
---|
94 | 94 | - For shared mappings, the reservation map hangs off the inode. Specifically, |
---|
.. | .. |
---|
109 | 109 | struct vm_area_struct *vma, |
---|
110 | 110 | vm_flags_t vm_flags) |
---|
111 | 111 | |
---|
112 | | -The first thing hugetlb_reserve_pages() does is check for the NORESERVE |
---|
| 112 | +The first thing hugetlb_reserve_pages() does is check if the NORESERVE |
---|
113 | 113 | flag was specified in either the shmget() or mmap() call. If NORESERVE |
---|
114 | | -was specified, then this routine returns immediately as no reservation |
---|
| 114 | +was specified, then this routine returns immediately as no reservations |
---|
115 | 115 | are desired. |
---|
116 | 116 | |
---|
117 | 117 | The arguments 'from' and 'to' are huge page indices into the mapping or |
---|
118 | 118 | underlying file. For shmget(), 'from' is always 0 and 'to' corresponds to |
---|
119 | 119 | the length of the segment/mapping. For mmap(), the offset argument could |
---|
120 | | -be used to specify the offset into the underlying file. In such a case |
---|
| 120 | +be used to specify the offset into the underlying file. In such a case, |
---|
121 | 121 | the 'from' and 'to' arguments have been adjusted by this offset. |
---|
122 | 122 | |
---|
123 | 123 | One of the big differences between PRIVATE and SHARED mappings is the way |
---|
.. | .. |
---|
138 | 138 | |
---|
139 | 139 | The reservation map is consulted to determine how many huge page reservations |
---|
140 | 140 | are needed for the current mapping/segment. For private mappings, this is |
---|
141 | | -always the value (to - from). However, for shared mappings it is possible that some reservations may already exist within the range (to - from). See the |
---|
| 141 | +always the value (to - from). However, for shared mappings it is possible that |
---|
| 142 | +some reservations may already exist within the range (to - from). See the |
---|
142 | 143 | section :ref:`Reservation Map Modifications <resv_map_modifications>` |
---|
143 | 144 | for details on how this is accomplished. |
---|
144 | 145 | |
---|
.. | .. |
---|
165 | 166 | If there were enough free huge pages and the global count resv_huge_pages |
---|
166 | 167 | was adjusted, then the reservation map associated with the mapping is |
---|
167 | 168 | modified to reflect the reservations. In the case of a shared mapping, a |
---|
168 | | -file_region will exist that includes the range 'from' 'to'. For private |
---|
| 169 | +file_region will exist that includes the range 'from' - 'to'. For private |
---|
169 | 170 | mappings, no modifications are made to the reservation map as lack of an |
---|
170 | 171 | entry indicates a reservation exists. |
---|
171 | 172 | |
---|
.. | .. |
---|
239 | 240 | The routine vma_commit_reservation() is then called to adjust the reserve |
---|
240 | 241 | map based on the consumption of the reservation. In general, this involves |
---|
241 | 242 | ensuring the page is represented within a file_region structure of the region |
---|
242 | | -map. For shared mappings where the the reservation was present, an entry |
---|
| 243 | +map. For shared mappings where the reservation was present, an entry |
---|
243 | 244 | in the reserve map already existed so no change is made. However, if there |
---|
244 | 245 | was no reservation in a shared mapping or this was a private mapping a new |
---|
245 | 246 | entry must be created. |
---|