From: "Pratyush Yadav (Google)" <[email protected]> Support for discovering memory blocks with no preserved memory will be added in coming patches. These areas will also be marked as MEMBLOCK_KHO_SCRATCH to allow allocations from them.
But only the scratch areas passed to KHO should be marked as MIGRATE_CMA, all others should be left as normal. So instead of checking the flags on the region, ask KHO to loop through its scratch array. Signed-off-by: Pratyush Yadav (Google) <[email protected]> --- include/linux/memblock.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 5afcd99aa8c1..546d7ef798b8 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -11,6 +11,7 @@ #include <linux/init.h> #include <linux/mm.h> #include <asm/dma.h> +#include <linux/kexec_handover.h> extern unsigned long max_low_pfn; extern unsigned long min_low_pfn; @@ -618,7 +619,7 @@ bool memblock_is_kho_scratch_memory(phys_addr_t addr); static inline enum migratetype kho_scratch_migratetype(unsigned long pfn, enum migratetype mt) { - if (memblock_is_kho_scratch_memory(PFN_PHYS(pfn))) + if (kho_scratch_overlap(PFN_PHYS(pfn), pageblock_nr_pages << PAGE_SHIFT)) return MIGRATE_CMA; return mt; } -- 2.54.0.1032.g2f8565e1d1-goog
