From 80c29b9ae61f1a4014f309d7ad5f1d13b7df3c35 Mon Sep 17 00:00:00 2001 From: Evgenii Shatokhin Date: Thu, 9 Mar 2017 15:02:52 +0300 Subject: [PATCH] Partially revert mainline commit 92923ca to fix a regression The following commit seems to cause problems with hibernation on 32-bit systems: commit 92923ca3aacef63c92dc297a75ad0c6dfe4eab37 Author: Nathan Zimmer Date: Tue Jun 30 14:56:48 2015 -0700 mm: meminit: only set page reserved in the memblock region Without this commit, it takes less than 10-15 seconds on our test system (https://linux-hardware.org/index.php?probe=e6a06c64c7) from "systemctl hibernate" command till the system powers off. With the mainline kernels 4.2-4.7, the system resumes OK. With this commit, it takes more than 2 minutes for that system to hibernate and it usually hangs on resume. Let us revert the main parts of this commit in the 32-bit kernels for now. --- kernel.spec | 3 ++ ...set-page-reserved-in-the-memblock-re.patch | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 revert-mm-meminit-only-set-page-reserved-in-the-memblock-re.patch diff --git a/kernel.spec b/kernel.spec index f0d4cf1..37332f6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -167,6 +167,9 @@ Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kve Source10: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kversion}.sign # ROSA-specific patches +%ifarch %{ix86} +Patch10: revert-mm-meminit-only-set-page-reserved-in-the-memblock-re.patch +%endif # Adds explicit linking of the Perf Python extension with libdl, thus fixing # the build. diff --git a/revert-mm-meminit-only-set-page-reserved-in-the-memblock-re.patch b/revert-mm-meminit-only-set-page-reserved-in-the-memblock-re.patch new file mode 100644 index 0000000..f000570 --- /dev/null +++ b/revert-mm-meminit-only-set-page-reserved-in-the-memblock-re.patch @@ -0,0 +1,47 @@ +The following commit seems to cause problems with hibernation on 32-bit +systems: + + commit 92923ca3aacef63c92dc297a75ad0c6dfe4eab37 + Author: Nathan Zimmer + Date: Tue Jun 30 14:56:48 2015 -0700 + + mm: meminit: only set page reserved in the memblock region + +Without this commit, it takes less than 10-15 seconds on our test system +(https://linux-hardware.org/index.php?probe=e6a06c64c7) from +"systemctl hibernate" command till the system powers off. With the mainline +kernels 4.2-4.7, the system resumes OK. + +With this commit, it takes more than 2 minutes for that system to hibernate +and it usually hangs on resume. + +Let us revert the main parts of this commit in the 32-bit kernels for now. + +Signed-off-by: Evgenii Shatokhin + +diff --git a/mm/nobootmem.c b/mm/nobootmem.c +index 487dad6..cfd91fa 100644 +--- a/mm/nobootmem.c ++++ b/mm/nobootmem.c +@@ -134,9 +134,6 @@ static unsigned long __init free_low_memory_core_early(void) + + memblock_clear_hotplug(0, -1); + +- for_each_reserved_mem_region(i, &start, &end) +- reserve_bootmem_region(start, end); +- + /* + * We need to use NUMA_NO_NODE instead of NODE_DATA(0)->node_id + * because in some case like Node0 doesn't have RAM installed +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index f3e0c69..ca32c26 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -1168,6 +1168,7 @@ static void __meminit __init_single_page(struct page *page, unsigned long pfn, + init_page_count(page); + page_mapcount_reset(page); + page_cpupid_reset_last(page); ++ SetPageReserved(page); + + INIT_LIST_HEAD(&page->lru); + #ifdef WANT_PAGE_VIRTUAL