hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/vm/hugetlbfs_reserv.rst
....@@ -85,10 +85,10 @@
8585 A huge page mapping or segment is either private or shared. If private,
8686 it is typically only available to a single address space (task). If shared,
8787 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
8989 of mappings. Location differences are:
9090
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.
9292 Specifically, vma->vm_private_data. This reserve map is created at the
9393 time the mapping (mmap(MAP_PRIVATE)) is created.
9494 - For shared mappings, the reservation map hangs off the inode. Specifically,
....@@ -109,15 +109,15 @@
109109 struct vm_area_struct *vma,
110110 vm_flags_t vm_flags)
111111
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
113113 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
115115 are desired.
116116
117117 The arguments 'from' and 'to' are huge page indices into the mapping or
118118 underlying file. For shmget(), 'from' is always 0 and 'to' corresponds to
119119 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,
121121 the 'from' and 'to' arguments have been adjusted by this offset.
122122
123123 One of the big differences between PRIVATE and SHARED mappings is the way
....@@ -138,7 +138,8 @@
138138
139139 The reservation map is consulted to determine how many huge page reservations
140140 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
142143 section :ref:`Reservation Map Modifications <resv_map_modifications>`
143144 for details on how this is accomplished.
144145
....@@ -165,7 +166,7 @@
165166 If there were enough free huge pages and the global count resv_huge_pages
166167 was adjusted, then the reservation map associated with the mapping is
167168 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
169170 mappings, no modifications are made to the reservation map as lack of an
170171 entry indicates a reservation exists.
171172
....@@ -239,7 +240,7 @@
239240 The routine vma_commit_reservation() is then called to adjust the reserve
240241 map based on the consumption of the reservation. In general, this involves
241242 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
243244 in the reserve map already existed so no change is made. However, if there
244245 was no reservation in a shared mapping or this was a private mapping a new
245246 entry must be created.