diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-13 08:19:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-13 08:19:37 +0200 |
commit | 991919e969043a4422dfebbcadf600a5d28b94e4 (patch) | |
tree | 4776f9f162c665a9735198fafc466d3e49a14253 /mm/hugetlb.c | |
parent | 73ed6faed58e5611abfb54c2f703eec091781d63 (diff) | |
parent | 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3 (diff) |
Merge 6.15-rc6 into char-misc-next
We need the iio/hyperv fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e3e6ac991b9c6..6ea1be71aa429 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4034,10 +4034,13 @@ static long demote_free_hugetlb_folios(struct hstate *src, struct hstate *dst, list_for_each_entry_safe(folio, next, src_list, lru) { int i; + bool cma; if (folio_test_hugetlb_vmemmap_optimized(folio)) continue; + cma = folio_test_hugetlb_cma(folio); + list_del(&folio->lru); split_page_owner(&folio->page, huge_page_order(src), huge_page_order(dst)); @@ -4053,6 +4056,9 @@ static long demote_free_hugetlb_folios(struct hstate *src, struct hstate *dst, new_folio->mapping = NULL; init_new_hugetlb_folio(dst, new_folio); + /* Copy the CMA flag so that it is freed correctly */ + if (cma) + folio_set_hugetlb_cma(new_folio); list_add(&new_folio->lru, &dst_list); } } |