The patch titled Subject: arm64: kdump: no need to mark crashkernel pages manually PG_reserved has been added to the -mm tree. Its filename is arm64-kdump-no-need-to-mark-crashkernel-pages-manually-pg_reserved.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/arm64-kdump-no-need-to-mark-crashkernel-pages-manually-pg_reserved.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/arm64-kdump-no-need-to-mark-crashkernel-pages-manually-pg_reserved.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: David Hildenbrand <david@xxxxxxxxxx> Subject: arm64: kdump: no need to mark crashkernel pages manually PG_reserved The crashkernel is reserved via memblock_reserve(). memblock_free_all() will call free_low_memory_core_early(), which will go over all reserved memblocks, marking the pages as PG_reserved. So manually marking pages as PG_reserved is not necessary, they are already in the desired state (otherwise they would have been handed over to the buddy as free pages and bad things would happen). Link: http://lkml.kernel.org/r/20190114125903.24845-8-david@xxxxxxxxxx Signed-off-by: David Hildenbrand <david@xxxxxxxxxx> Reviewed-by: Matthias Brugger <mbrugger@xxxxxxxx> Reviewed-by: Bhupesh Sharma <bhsharma@xxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: James Morse <james.morse@xxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Florian Fainelli <f.fainelli@xxxxxxxxx> Cc: Stefan Agner <stefan@xxxxxxxx> Cc: Laura Abbott <labbott@xxxxxxxxxx> Cc: Greg Hackmann <ghackmann@xxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Kristina Martsenko <kristina.martsenko@xxxxxxx> Cc: CHANDAN VN <chandan.vn@xxxxxxxxxxx> Cc: AKASHI Takahiro <takahiro.akashi@xxxxxxxxxx> Cc: Logan Gunthorpe <logang@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/arm64/kernel/machine_kexec.c | 2 +- arch/arm64/mm/init.c | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) --- a/arch/arm64/kernel/machine_kexec.c~arm64-kdump-no-need-to-mark-crashkernel-pages-manually-pg_reserved +++ a/arch/arm64/kernel/machine_kexec.c @@ -321,7 +321,7 @@ void crash_post_resume(void) * but does not hold any data of loaded kernel image. * * Note that all the pages in crash dump kernel memory have been initially - * marked as Reserved in kexec_reserve_crashkres_pages(). + * marked as Reserved as memory was allocated via memblock_reserve(). * * In hibernation, the pages which are Reserved and yet "nosave" are excluded * from the hibernation iamge. crash_is_nosave() does thich check for crash --- a/arch/arm64/mm/init.c~arm64-kdump-no-need-to-mark-crashkernel-pages-manually-pg_reserved +++ a/arch/arm64/mm/init.c @@ -118,35 +118,10 @@ static void __init reserve_crashkernel(v crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size - 1; } - -static void __init kexec_reserve_crashkres_pages(void) -{ -#ifdef CONFIG_HIBERNATION - phys_addr_t addr; - struct page *page; - - if (!crashk_res.end) - return; - - /* - * To reduce the size of hibernation image, all the pages are - * marked as Reserved initially. - */ - for (addr = crashk_res.start; addr < (crashk_res.end + 1); - addr += PAGE_SIZE) { - page = phys_to_page(addr); - SetPageReserved(page); - } -#endif -} #else static void __init reserve_crashkernel(void) { } - -static void __init kexec_reserve_crashkres_pages(void) -{ -} #endif /* CONFIG_KEXEC_CORE */ #ifdef CONFIG_CRASH_DUMP @@ -586,8 +561,6 @@ void __init mem_init(void) /* this will put all unused low memory onto the freelists */ memblock_free_all(); - kexec_reserve_crashkres_pages(); - mem_init_print_info(NULL); /* _ Patches currently in -mm which might be from david@xxxxxxxxxx are mm-balloon-update-comment-about-isolation-migration-compaction.patch mm-convert-pg_balloon-to-pg_offline.patch kexec-export-pg_offline-to-vmcoreinfo.patch xen-balloon-mark-inflated-pages-pg_offline.patch hv_balloon-mark-inflated-pages-pg_offline.patch vmw_balloon-mark-inflated-pages-pg_offline.patch vmw_balloon-mark-inflated-pages-pg_offline-v2.patch pm-hibernate-use-pfn_to_online_page.patch pm-hibernate-exclude-all-pageoffline-pages.patch pm-hibernate-exclude-all-pageoffline-pages-v2.patch agp-efficeon-no-need-to-set-pg_reserved-on-gatt-tables.patch s390-vdso-dont-clear-pg_reserved.patch powerpc-vdso-dont-clear-pg_reserved.patch riscv-vdso-dont-clear-pg_reserved.patch m68k-mm-use-__clearpagereserved.patch arm64-kexec-no-need-to-clearpagereserved.patch arm64-kdump-no-need-to-mark-crashkernel-pages-manually-pg_reserved.patch ia64-perfmon-dont-mark-buffer-pages-as-pg_reserved.patch mm-better-document-pg_reserved.patch