[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2299c1a5b8773c955e7d0c3803ad3fc6c83c127a.camel@linux.intel.com>
Date: Thu, 20 Jun 2019 09:10:44 -0700
From: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
To: Juergen Gross <jgross@...e.com>, xen-devel@...ts.xenproject.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: fix regression with deferred struct page init
On Thu, 2019-06-20 at 18:08 +0200, Juergen Gross wrote:
> Commit 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time
> instead of doing larger sections") is causing a regression on some
> systems when the kernel is booted as Xen dom0.
>
> The system will just hang in early boot.
>
> Reason is an endless loop in get_page_from_freelist() in case the first
> zone looked at has no free memory. deferred_grow_zone() is always
> returning true due to the following code snipplet:
>
> /* If the zone is empty somebody else may have cleared out the zone */
> if (!deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn,
> first_deferred_pfn)) {
> pgdat->first_deferred_pfn = ULONG_MAX;
> pgdat_resize_unlock(pgdat, &flags);
> return true;
> }
>
> This in turn results in the loop as get_page_from_freelist() is
> assuming forward progress can be made by doing some more struct page
> initialization.
>
> Cc: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
> Fixes: 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections")
> Suggested-by: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
> Signed-off-by: Juergen Gross <jgross@...e.com>
Acked-by: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
> ---
> mm/page_alloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index d66bc8abe0af..8e3bc949ebcc 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1826,7 +1826,8 @@ deferred_grow_zone(struct zone *zone, unsigned int order)
> first_deferred_pfn)) {
> pgdat->first_deferred_pfn = ULONG_MAX;
> pgdat_resize_unlock(pgdat, &flags);
> - return true;
> + /* Retry only once. */
> + return first_deferred_pfn != ULONG_MAX;
> }
>
> /*
Powered by blists - more mailing lists