aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-03-25 08:17:25 +0100
committerIngo Molnar <mingo@kernel.org>2025-03-25 08:17:25 +0100
commit2487b6b9bf2874cfca7efb59c95650c5b1d88d43 (patch)
tree8bd7a32686e006b1cbeeb80511114c63ac442c87 /mm/hugetlb.c
parentx86/speculation: Remove the extra #ifdef around CALL_NOSPEC (diff)
parentx86 boot build: make git ignore stale 'tools' directory (diff)
downloadwireguard-linux-2487b6b9bf2874cfca7efb59c95650c5b1d88d43.tar.xz
wireguard-linux-2487b6b9bf2874cfca7efb59c95650c5b1d88d43.zip
Merge branch 'linus' into x86/urgent, to pick up fixes and refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '')
-rw-r--r--mm/hugetlb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 97930d44d460..318624c96584 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2135,6 +2135,8 @@ retry:
if (!folio_ref_count(folio)) {
struct hstate *h = folio_hstate(folio);
+ bool adjust_surplus = false;
+
if (!available_huge_pages(h))
goto out;
@@ -2157,7 +2159,9 @@ retry:
goto retry;
}
- remove_hugetlb_folio(h, folio, false);
+ if (h->surplus_huge_pages_node[folio_nid(folio)])
+ adjust_surplus = true;
+ remove_hugetlb_folio(h, folio, adjust_surplus);
h->max_huge_pages--;
spin_unlock_irq(&hugetlb_lock);
@@ -2177,7 +2181,7 @@ retry:
rc = hugetlb_vmemmap_restore_folio(h, folio);
if (rc) {
spin_lock_irq(&hugetlb_lock);
- add_hugetlb_folio(h, folio, false);
+ add_hugetlb_folio(h, folio, adjust_surplus);
h->max_huge_pages++;
goto out;
}