[PATCH] mm/ZONE_DEVICE: Keep ZONE_DEVICE out of allocation zonelist.

From: JÃrÃme Glisse
Date: Mon Aug 17 2015 - 17:31:27 EST


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éme Glisse <jglisse@xxxxxxxxxx>
---
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


--17pEHd4RhPHOinZp--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/