From 41eee5319f475b568536caa3e769861f6cfd0b7e Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Tue, 13 Mar 2018 20:46:11 -0700 Subject: [PATCH] Fix for boot hang on arm64 (rhbz 1554954) --- kernel.spec | 3 + ...oc-fix-boot-hang-in-memmap_init_zone.patch | 58 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 mm-page_alloc-fix-boot-hang-in-memmap_init_zone.patch diff --git a/kernel.spec b/kernel.spec index 41c124601..9a6144ede 100644 --- a/kernel.spec +++ b/kernel.spec @@ -622,6 +622,9 @@ Patch502: input-rmi4-remove-the-need-for-artifical-IRQ.patch # rhbz 1509461 Patch503: v3-2-2-Input-synaptics---Lenovo-X1-Carbon-5-should-use-SMBUS-RMI.patch +# rhbz 1554954 +Patch504: mm-page_alloc-fix-boot-hang-in-memmap_init_zone.patch + # END OF PATCH DEFINITIONS %endif diff --git a/mm-page_alloc-fix-boot-hang-in-memmap_init_zone.patch b/mm-page_alloc-fix-boot-hang-in-memmap_init_zone.patch new file mode 100644 index 000000000..466493db3 --- /dev/null +++ b/mm-page_alloc-fix-boot-hang-in-memmap_init_zone.patch @@ -0,0 +1,58 @@ +From patchwork Tue Mar 13 22:42:40 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: mm/page_alloc: fix boot hang in memmap_init_zone +From: Daniel Vacek +X-Patchwork-Id: 10281093 +Message-Id: <20180313224240.25295-1-neelx@redhat.com> +To: linux-kernel@vger.kernel.org, linux-mm@kvack.org +Cc: Sudeep Holla , + Naresh Kamboju , + Daniel Vacek , Andrew Morton , + Mel Gorman , Michal Hocko , + Paul Burton , + Pavel Tatashin , + Vlastimil Babka , stable@vger.kernel.org +Date: Tue, 13 Mar 2018 23:42:40 +0100 + +On some architectures (reported on arm64) commit 864b75f9d6b01 ("mm/page_alloc: fix memmap_init_zone pageblock alignment") +causes a boot hang. This patch fixes the hang making sure the alignment +never steps back. + +Link: http://lkml.kernel.org/r/0485727b2e82da7efbce5f6ba42524b429d0391a.1520011945.git.neelx@redhat.com +Fixes: 864b75f9d6b01 ("mm/page_alloc: fix memmap_init_zone pageblock alignment") +Signed-off-by: Daniel Vacek +Tested-by: Sudeep Holla +Tested-by: Naresh Kamboju +Cc: Andrew Morton +Cc: Mel Gorman +Cc: Michal Hocko +Cc: Paul Burton +Cc: Pavel Tatashin +Cc: Vlastimil Babka +Cc: +--- + mm/page_alloc.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 3d974cb2a1a1..e033a6895c6f 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -5364,9 +5364,14 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, + * is not. move_freepages_block() can shift ahead of + * the valid region but still depends on correct page + * metadata. ++ * Also make sure we never step back. + */ +- pfn = (memblock_next_valid_pfn(pfn, end_pfn) & ++ unsigned long next_pfn; ++ ++ next_pfn = (memblock_next_valid_pfn(pfn, end_pfn) & + ~(pageblock_nr_pages-1)) - 1; ++ if (next_pfn > pfn) ++ pfn = next_pfn; + #endif + continue; + }