From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by kanga.kvack.org (Postfix) with ESMTP id CFFCA8292A for ; Thu, 12 Feb 2015 02:30:36 -0500 (EST) Received: by pdjz10 with SMTP id z10so10205060pdj.0 for ; Wed, 11 Feb 2015 23:30:36 -0800 (PST) Received: from lgemrelse7q.lge.com (LGEMRELSE7Q.lge.com. [156.147.1.151]) by mx.google.com with ESMTP id is2si3895195pbb.146.2015.02.11.23.30.14 for ; Wed, 11 Feb 2015 23:30:15 -0800 (PST) From: Joonsoo Kim Subject: [RFC 15/16] mm/cma: remove ALLOC_CMA Date: Thu, 12 Feb 2015 16:32:19 +0900 Message-Id: <1423726340-4084-16-git-send-email-iamjoonsoo.kim@lge.com> In-Reply-To: <1423726340-4084-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1423726340-4084-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Rik van Riel , Johannes Weiner , Mel Gorman , Laura Abbott , Minchan Kim , Heesub Shin , Marek Szyprowski , Michal Nazarewicz , "Aneesh Kumar K.V" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hui Zhu , Gioh Kim , Bartlomiej Zolnierkiewicz , Ritesh Harjani , Vlastimil Babka , Joonsoo Kim Now, reserved pages for CMA are on ZONE_CMA and it only serves for MIGRATE_MOVABLE. Therefore, we don't need to consider ALLOC_CMA at all. Signed-off-by: Joonsoo Kim --- mm/compaction.c | 4 ---- mm/internal.h | 3 +-- mm/page_alloc.c | 16 ++-------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index f9792ba..b79134e 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1312,10 +1312,6 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, if (!order || !may_enter_fs || !may_perform_io) return COMPACT_SKIPPED; -#ifdef CONFIG_CMA - if (gfpflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE) - alloc_flags |= ALLOC_CMA; -#endif /* Compact each zone in the list */ for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx, nodemask) { diff --git a/mm/internal.h b/mm/internal.h index a4f90ba..9968dff 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -407,7 +407,6 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone, #define ALLOC_HARDER 0x10 /* try to alloc harder */ #define ALLOC_HIGH 0x20 /* __GFP_HIGH set */ #define ALLOC_CPUSET 0x40 /* check for correct cpuset */ -#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */ -#define ALLOC_FAIR 0x100 /* fair zone allocation */ +#define ALLOC_FAIR 0x80 /* fair zone allocation */ #endif /* __MM_INTERNAL_H */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f2844f0..551cc5b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1737,20 +1737,14 @@ static bool __zone_watermark_ok(struct zone *z, unsigned int order, /* free_pages my go negative - that's OK */ long min = mark; int o; - long free_cma = 0; free_pages -= (1 << order) - 1; if (alloc_flags & ALLOC_HIGH) min -= min / 2; if (alloc_flags & ALLOC_HARDER) min -= min / 4; -#ifdef CONFIG_CMA - /* If allocation can't use CMA areas don't use free CMA pages */ - if (!(alloc_flags & ALLOC_CMA)) - free_cma = zone_page_state(z, NR_FREE_CMA_PAGES); -#endif - if (free_pages - free_cma <= min + z->lowmem_reserve[classzone_idx]) + if (free_pages <= min + z->lowmem_reserve[classzone_idx]) return false; for (o = 0; o < order; o++) { /* At the next order, this order's pages become unavailable */ @@ -2550,10 +2544,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask) unlikely(test_thread_flag(TIF_MEMDIE)))) alloc_flags |= ALLOC_NO_WATERMARKS; } -#ifdef CONFIG_CMA - if (gfpflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE) - alloc_flags |= ALLOC_CMA; -#endif + return alloc_flags; } @@ -2837,9 +2828,6 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, if (unlikely(!zonelist->_zonerefs->zone)) return NULL; - if (IS_ENABLED(CONFIG_CMA) && migratetype == MIGRATE_MOVABLE) - alloc_flags |= ALLOC_CMA; - retry_cpuset: cpuset_mems_cookie = read_mems_allowed_begin(); -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org