diff options
| author | Levi Yun <[email protected]> | 2023-01-18 17:05:23 +0900 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-02-02 22:33:24 -0800 |
| commit | 148aa87e4f631e98d926d006604116fd2b2f3a93 (patch) | |
| tree | 03aaaf5d8bb58ba5f6e6a008a0c15fb4f81bd7bf /tools/perf/scripts/python/task-analyzer.py | |
| parent | 5649d113ffce9f532a9ecc5ab96a93e02efbf283 (diff) | |
mm/cma: fix potential memory loss on cma_declare_contiguous_nid
Suppose memblock_alloc_range_nid() with highmem_start succeeds when
cma_declare_contiguous_nid is called with !fixed on a 32-bit system with
PHYS_ADDR_T_64BIT enabled with memblock.bottom_up == false.
But the next trial to memblock_alloc_range_nid() to allocate in [SIZE_4G,
limits) nullifies former successfully allocated addr and it retries
memblock_alloc_ragne_nid().
In this situation, the first successfully allocated address area is lost.
Change the order of allocation (SIZE_4G, high_memory and base) and check
whether the allocated succeeded to prevent potential memory loss.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Levi Yun <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions