>From 45976e1186eee45ecb277fe5293a7cfa7466d740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= Date: Mon, 17 Aug 2015 17:31:27 -0400 Subject: [PATCH] mm/ZONE_DEVICE: Keep ZONE_DEVICE out of allocation zonelist. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Memory inside a ZONE_DEVICE should never be consider by the buddy allocator and thus any such zone should never be added to any of the zonelist. This patch just do that. Signed-off-by: Jérôme Glisse --- mm/page_alloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ef19f22..f3e26de 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3834,6 +3834,13 @@ static int build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist, do { zone_type--; zone = pgdat->node_zones + zone_type; + /* + * Device zone is special memory and should never be consider + * for regular allocation. It is expected that page in device + * zone will be allocated by other means. + */ + if (is_dev_zone(zone)) + continue; if (populated_zone(zone)) { zoneref_set_zone(zone, &zonelist->_zonerefs[nr_zones++]); -- 1.8.3.1