diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 308b570cdcecf57cf6647ac46029d2a149245bec..9bf6ce119d6dd212b65464cd07f8aa631c4e4af5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5981,6 +5981,16 @@ static void build_zonelists(pg_data_t *pgdat) memset(node_order, 0, sizeof(node_order)); while ((node = find_next_best_node(local_node, &used_mask)) >= 0) { +#ifdef CONFIG_COHERENT_DEVICE + /* + * CDM node's own zones should not be part of any other + * node's fallback zonelist but only it's own fallback + * zonelist. + */ + if (is_cdm_node(node) && (pgdat->node_id != node)) + continue; +#endif + /* * We don't want to pressure a particular node. * So adding penalty to the first node in same