aboutsummaryrefslogtreecommitdiffstats
path: root/lib/alloc_tag.c
diff options
context:
space:
mode:
authorVivek Kasireddy <[email protected]>2025-06-18 05:30:54 +0000
committerAndrew Morton <[email protected]>2025-07-10 05:42:15 +0000
commit717cf9357325055ab6b41c4e0581f4d67601eb58 (patch)
tree15ae38c923350aa808ff2dc403855da513117e3e /lib/alloc_tag.c
parentmm/hugetlb: make hugetlb_reserve_pages() return nr of entries updated (diff)
downloadkernel-717cf9357325055ab6b41c4e0581f4d67601eb58.tar.gz
kernel-717cf9357325055ab6b41c4e0581f4d67601eb58.zip
mm/memfd: reserve hugetlb folios before allocation
When we try to allocate a folio via alloc_hugetlb_folio_reserve(), we need to ensure that there is an active reservation associated with the allocation. Otherwise, our allocation request would fail if there are no active reservations made at that moment against any other allocations. This is because alloc_hugetlb_folio_reserve() checks h->resv_huge_pages before proceeding with the allocation. Therefore, to address this issue, we just need to make a reservation (by calling hugetlb_reserve_pages()) before we try to allocate the folio. This will also ensure that proper region/subpool accounting is done associated with our allocation. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Vivek Kasireddy <[email protected]> Cc: Steve Sistare <[email protected]> Cc: Muchun Song <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Oscar Salvador <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/alloc_tag.c')
0 files changed, 0 insertions, 0 deletions