aboutsummaryrefslogtreecommitdiffstats
path: root/lib/alloc_tag.c
diff options
context:
space:
mode:
authorVivek Kasireddy <[email protected]>2025-06-18 05:30:53 +0000
committerAndrew Morton <[email protected]>2025-07-10 05:42:14 +0000
commit986f5f2b4be3b7eab9ecd85c472d03a2191d6fc0 (patch)
tree1a8be426356a2b12232678a16a757d9c22bf250a /lib/alloc_tag.c
parentcodetag: avoid unused alloc_tags sections/symbols (diff)
downloadkernel-986f5f2b4be3b7eab9ecd85c472d03a2191d6fc0.tar.gz
kernel-986f5f2b4be3b7eab9ecd85c472d03a2191d6fc0.zip
mm/hugetlb: make hugetlb_reserve_pages() return nr of entries updated
Patch series "mm/memfd: Reserve hugetlb folios before allocation", v4. There are cases when we try to pin a folio but discover that it has not been faulted-in. So, we try to allocate it in memfd_alloc_folio() but the allocation request may not succeed if there are no active reservations in the system at that instant. Therefore, making a reservation (by calling hugetlb_reserve_pages()) associated with the allocation will ensure that our request would not fail due to lack of reservations. This will also ensure that proper region/subpool accounting is done with our allocation. This patch (of 3): Currently, hugetlb_reserve_pages() returns a bool to indicate whether the reservation map update for the range [from, to] was successful or not. This is not sufficient for the case where the caller needs to determine how many entries were updated for the range. Therefore, have hugetlb_reserve_pages() return the number of entries updated in the reservation map associated with the range [from, to]. Also, update the callers of hugetlb_reserve_pages() to handle the new return value. Link: https://lkml.kernel.org/r/[email protected] 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