Revert "FROMGIT: mm/cma.c: delete kmemleak objects when freeing CMA areas to buddy at boot"

This reverts commit 6d9e986186. This
solution was ultimately not merged upstream. Revert this commit so that
the proper solution that was merged upstream [1] can be applied to this
branch.

[1]: https://lore.kernel.org/all/20230208232001.2052777-1-isaacmanjarres@google.com/
Bug: 265065728
Change-Id: I9b1d0b53a23945c99b4507ca2db89a496b804463
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
This commit is contained in:
Isaac J. Manjarres
2023-02-13 16:09:51 -08:00
committed by Matthias Männich
parent 5c6418ddee
commit 5862eafd8e

View File

@@ -111,13 +111,6 @@ static void __init cma_activate_area(struct cma *cma)
if (!cma->bitmap)
goto out_error;
/*
* The CMA region was marked as allocated by kmemleak when it was either
* dynamically allocated or statically reserved. In any case,
* inform kmemleak that the region is about to be freed to the page allocator.
*/
kmemleak_free_part_phys(cma_get_base(cma), cma_get_size(cma));
/*
* alloc_contig_range() requires the pfn range specified to be in the
* same zone. Simplify by forcing the entire CMA resv range to be in the
@@ -380,6 +373,11 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
}
}
/*
* kmemleak scans/reads tracked objects for pointers to other
* objects but this address isn't mapped and accessible
*/
kmemleak_ignore_phys(addr);
base = addr;
}