Skip to content

Commit 0619073

Browse files
jchu314atgithubgregkh
authored andcommitted
Documentation: fix a hugetlbfs reservation statement
[ Upstream commit 7a197d3 ] Documentation/mm/hugetlbfs_reserv.rst has if (resv_needed <= (resv_huge_pages - free_huge_pages)) resv_huge_pages += resv_needed; which describes this code in gather_surplus_pages() needed = (h->resv_huge_pages + delta) - h->free_huge_pages; if (needed <= 0) { h->resv_huge_pages += delta; return 0; } which means if there are enough free hugepages to account for the new reservation, simply update the global reservation count without further action. But the description is backwards, it should be if (resv_needed <= (free_huge_pages - resv_huge_pages)) instead. Link: https://lkml.kernel.org/r/20260302201015.1824798-1-jane.chu@oracle.com Fixes: 70bc0dc ("Documentation: vm, add hugetlbfs reservation overview") Signed-off-by: Jane Chu <jane.chu@oracle.com> Cc: David Hildenbrand <david@kernel.org> Cc: Hillf Danton <hillf.zj@alibaba-inc.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Oscar Salvador <osalvador@suse.de> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fc1ca4f commit 0619073

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Documentation/mm/hugetlbfs_reserv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ are enough free huge pages to accommodate the reservation. If there are,
155155
the global reservation count resv_huge_pages is adjusted something like the
156156
following::
157157

158-
if (resv_needed <= (resv_huge_pages - free_huge_pages))
158+
if (resv_needed <= (free_huge_pages - resv_huge_pages)
159159
resv_huge_pages += resv_needed;
160160

161161
Note that the global lock hugetlb_lock is held when checking and adjusting

0 commit comments

Comments
 (0)