Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3543264imu; Mon, 14 Jan 2019 05:02:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Kk+lSSA/OB/jH3XaEkcTMB/zSDv7KBAjlE6i3Al4gEYzl7tFiLKle57JCgnsN7kAelrOg X-Received: by 2002:a62:109b:: with SMTP id 27mr24851752pfq.227.1547470939811; Mon, 14 Jan 2019 05:02:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470939; cv=none; d=google.com; s=arc-20160816; b=wxwd3bRzGIyjjar/q3otTzo5Q9vulEQ4ZwYMN5WdSyFVyl+VGV6pGL4cd0ejOt2DRB gLTUKPCHLLhMCmfqs5c1erY0WueVbFm6KCqLtjLaeWeCJ99N+0m3k8/LVhTCpGWSprY6 fKHbdBA8U6l10DLw8x5NSd+d+yZINq1vBYlzuoTzl9w+e9yu8jZUXcTvkKwLokJsUak9 /Q12q00DHXwhWYjJGIq6ywwWdgxp4e4R2k7DLZ1BKXvg93/QI9uliuyfM6iYP66cJPeD heXnK6LfS555bF22/jn1OUcQ5/vLNoPYpadoPCKowyrxsfOwl9QgdJS4omltZVn66Yv9 JbrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=TfVqJzn58+aN73fiEb8YQ9OGV+gvW4QvjxrwkR+KcuU=; b=guT4CRO+roBVwTIInvey/Ho+dZZmZvAYmw0hd1yw5uReUpXUBdElTfwKWaVSKstuUz Gk1CkWVAueEJmcbayoGXX4U3eyEdxgKSNA2DskJOdwsLaNPfFkTjMCU2cHyKJ0+rXxJQ 4mrAiRnqsXG7JTXO31/jCNxqiWphoUo4htZyvyxLKurPYl7aTTLebxrFpi5lonjT6mR5 SutXAJ01cNe91rrcDof3foukF8Nzac3YiuOXc65/8aX6cPnfAwNYsbpR2VW4sABWuzY3 koFSYT3bEXydAuRt6qa0gd1L6aF/mv1jxuvVjhoGkW1MDaNGEXSVXOO1fgmIr+62AAyv tJ8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69si187842pgd.284.2019.01.14.05.02.03; Mon, 14 Jan 2019 05:02:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfANNAF (ORCPT + 99 others); Mon, 14 Jan 2019 08:00:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726610AbfANNAF (ORCPT ); Mon, 14 Jan 2019 08:00:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBC1BC057F3B; Mon, 14 Jan 2019 13:00:02 +0000 (UTC) Received: from t460s.redhat.com (unknown [10.36.118.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BDEA5D75F; Mon, 14 Jan 2019 12:59:50 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-mediatek@lists.infradead.org, David Hildenbrand , Catalin Marinas , Will Deacon , James Morse , Bhupesh Sharma , Mark Rutland , Dave Kleikamp , Andrew Morton , Mike Rapoport , Michal Hocko , Florian Fainelli , Stefan Agner , Laura Abbott , Greg Hackmann , Johannes Weiner , Kristina Martsenko , CHANDAN VN , AKASHI Takahiro , Logan Gunthorpe Subject: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved Date: Mon, 14 Jan 2019 13:59:01 +0100 Message-Id: <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-1-david@redhat.com> References: <20190114125903.24845-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 14 Jan 2019 13:00:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Cc: Catalin Marinas Cc: Will Deacon Cc: James Morse Cc: Bhupesh Sharma Cc: David Hildenbrand Cc: Mark Rutland Cc: Dave Kleikamp Cc: Andrew Morton Cc: Mike Rapoport Cc: Michal Hocko Cc: Florian Fainelli Cc: Stefan Agner Cc: Laura Abbott Cc: Greg Hackmann Cc: Johannes Weiner Cc: Kristina Martsenko Cc: CHANDAN VN Cc: AKASHI Takahiro Cc: Logan Gunthorpe Reviewed-by: Matthias Brugger Signed-off-by: David Hildenbrand --- arch/arm64/kernel/machine_kexec.c | 2 +- arch/arm64/mm/init.c | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index 6f0587b5e941..66b5d697d943 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/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 diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 7205a9085b4d..c38976b70069 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -118,35 +118,10 @@ static void __init reserve_crashkernel(void) 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); /* -- 2.17.2