diff --git a/mm/compaction.c b/mm/compaction.c index 2d9ee59ff2b1..e35f49150e2b 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -637,7 +637,11 @@ isolate_freepages_range(struct compact_control *cc, /* Similar to reclaim, but different enough that they don't share logic */ static bool too_many_isolated(struct zone *zone) { +#ifdef CONFIG_AMLOGIC_CMA + signed long active, inactive, isolated; +#else unsigned long active, inactive, isolated; +#endif inactive = node_page_state(zone->zone_pgdat, NR_INACTIVE_FILE) + node_page_state(zone->zone_pgdat, NR_INACTIVE_ANON); @@ -646,6 +650,13 @@ static bool too_many_isolated(struct zone *zone) isolated = node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE) + node_page_state(zone->zone_pgdat, NR_ISOLATED_ANON); +#ifdef CONFIG_AMLOGIC_CMA + isolated -= global_page_state(NR_CMA_ISOLATED); + WARN_ONCE(isolated > (inactive + active) / 2, + "isolated:%ld, cma:%ld, inactive:%ld, active:%ld\n", + isolated, global_page_state(NR_CMA_ISOLATED), + inactive, active); +#endif /* CONFIG_AMLOGIC_CMA */ return isolated > (inactive + active) / 2; } #ifdef CONFIG_AMLOGIC_CMA