Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()
From: Qian Cai
Date: Thu Oct 03 2019 - 05:05:54 EST
> On Oct 3, 2019, at 4:10 AM, Anshuman Khandual <Anshuman.Khandual@xxxxxxx> wrote:
>
> Having unmovable pages on a given pageblock should be reported correctly
> when required with REPORT_FAILURE flag. But there can be a scenario where a
> reserved page in the page block will get reported as a generic "unmovable"
> reason code. Instead this should be changed to a more appropriate reason
> code like "Reserved page".
Isnât this redundant as it dumps the flags in dump_page() anyway?
>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Michal Hocko <mhocko@xxxxxxxx>
> Cc: Vlastimil Babka <vbabka@xxxxxxx>
> Cc: Oscar Salvador <osalvador@xxxxxxx>
> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx>
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> Cc: Pavel Tatashin <pavel.tatashin@xxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
> ---
> mm/page_alloc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 15c2050c629b..fbf93ea119d2 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -8206,8 +8206,10 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
>
> page = pfn_to_page(check);
>
> - if (PageReserved(page))
> + if (PageReserved(page)) {
> + reason = "Reserved page";
> goto unmovable;
> + }
>
> /*
> * If the zone is movable and we have ruled out all reserved
> --
> 2.20.1
>