[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190412202625.GJ5223@dhcp22.suse.cz>
Date: Fri, 12 Apr 2019 22:26:25 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Qian Cai <cai@....pw>
Cc: akpm@...ux-foundation.org, osalvador@...e.de, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm/hotplug: treat CMA pages as unmovable
On Fri 12-04-19 11:26:59, Qian Cai wrote:
[...]
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index d96ca5bc555b..a9d2b0236167 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -8005,7 +8005,10 @@ void *__init alloc_large_system_hash(const char *tablename,
> bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
> int migratetype, int flags)
> {
> - unsigned long pfn, iter, found;
> + unsigned long found;
> + unsigned long iter = 0;
> + unsigned long pfn = page_to_pfn(page);
> + char reason[] = "unmovable page";
const char *reason = "unovable page";
>
> /*
> * TODO we could make this much more efficient by not checking every
> @@ -8015,17 +8018,20 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
> * can still lead to having bootmem allocations in zone_movable.
> */
>
> - /*
> - * CMA allocations (alloc_contig_range) really need to mark isolate
> - * CMA pageblocks even when they are not movable in fact so consider
> - * them movable here.
> - */
> - if (is_migrate_cma(migratetype) &&
> - is_migrate_cma(get_pageblock_migratetype(page)))
> - return false;
> + if (is_migrate_cma(get_pageblock_migratetype(page))) {
> + /*
> + * CMA allocations (alloc_contig_range) really need to mark
> + * isolate CMA pageblocks even when they are not movable in fact
> + * so consider them movable here.
> + */
> + if (is_migrate_cma(migratetype))
> + return false;
> +
> + strscpy(reason, "CMA page", 9);
reason = "CMA page";
> + goto unmovable;
> + }
Other than that looks good. After fixing the above, feel free to add
Acked-by: Michal Hocko <mhocko@...e.com>
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists