From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2B89C43387 for ; Mon, 14 Jan 2019 15:53:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DA85206B7 for ; Mon, 14 Jan 2019 15:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbfANPxr (ORCPT ); Mon, 14 Jan 2019 10:53:47 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:45178 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbfANPxr (ORCPT ); Mon, 14 Jan 2019 10:53:47 -0500 Received: by mail-lf1-f67.google.com with SMTP id b20so15917615lfa.12 for ; Mon, 14 Jan 2019 07:53:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZITMFUMV0zEIamJ3VVbE4heK6bK4WYzVzsFXzCFVH0=; b=cMTcKlW7mTmSsF5ns/M3RRi3GP1DJXgu/uuIeQ9i8YxHzSUOZxIAR/HvkjcxoquW5l crhwNWjIbalJ9nmjtSYLhZaulMcC0Fsl23FLVU9h/KfJ/BVqtT0m4Q4gadpe13gKSqZ8 yRRDssIap0txMHXuTdI3HSGe72w2hZSpJiScpFP5pZwWDdryWy1hIoRyL0tZGzcxo09N Cmz9IPBx07YJZ/vx7+B+akF8F6LhbDVTJ6UIR+jr6/8cDGaknVkN3doLTmeofPojDfCb wRhSmWVv+ZtOMz3M82RfNtd0nlEYWJdaSbaxZSHR2tWDXs8n+yOAUNH7XTE09q69wbSK rICQ== X-Gm-Message-State: AJcUukeZrnt5lsmCAYkS8BahTtX+WD3NpZxeKLhoTdtJ1n2sQONUHKoM M2hDBlc4Qg+7EKCGTcgpJQWbP/FqUFi/lroeMLFuUQ== X-Google-Smtp-Source: ALg8bN74ZQTuDIjsqUhLgFMGYUxSw81lMr9Ia6Rp9LV1zOdpgU9nkrJsrZPjHC4E0QC4PQUfRTidFXCqru+uICR4BPA= X-Received: by 2002:ac2:51af:: with SMTP id f15mr13329880lfk.44.1547481224807; Mon, 14 Jan 2019 07:53:44 -0800 (PST) MIME-Version: 1.0 References: <20190114125903.24845-1-david@redhat.com> <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-8-david@redhat.com> From: Bhupesh Sharma Date: Mon, 14 Jan 2019 21:22:49 +0530 Message-ID: Subject: Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved To: David Hildenbrand Cc: linux-mm@kvack.org, Linux Kernel Mailing List , linux-arm-kernel , 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, Catalin Marinas , Will Deacon , James Morse , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > 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 LGTM, so: Reviewed-by: Bhupesh Sharma From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20190114125903.24845-1-david@redhat.com> <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-8-david@redhat.com> From: Bhupesh Sharma Date: Mon, 14 Jan 2019 21:22:49 +0530 Message-ID: Subject: Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org List-Archive: To: David Hildenbrand Cc: Mark Rutland , Michal Hocko , CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Florian Fainelli , AKASHI Takahiro , Laura Abbott , Kristina Martsenko , linux-m68k@lists.linux-m68k.org, Mike Rapoport , linux-mediatek@lists.infradead.org, linux-arm-kernel , Logan Gunthorpe , Linux Kernel Mailing List , Dave Kleikamp , James Morse , Johannes Weiner , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Greg Hackmann List-ID: Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > 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 LGTM, so: Reviewed-by: Bhupesh Sharma _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2166AC43387 for ; Mon, 14 Jan 2019 15:54:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF38E206B7 for ; Mon, 14 Jan 2019 15:54:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZFTKGQSX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF38E206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IA794X7ujRnP9w7kH5pfzv6YC1hMqmIX9QnFSaRmx+c=; b=ZFTKGQSXCa5Czk 8Op7U+M1eW8/YdQt6jLx1gdxqwhVEzTFFXUwdf4/ip6wd6KSuAUqoE6lIDSDa7eiZtIQOcPT0X3dD /z8clnoIJ7TFvaOPj1H/ol9tUI3CfzN/ZwyWkyuYHZFjz/bv5Mm20Jcg92G1/H5pTT4Lr+0jRwMzs d6BsyHKN36eWnHKe+Sd0Bj+lbkU7KWNMoNyNKFx0PVHB/Je6fKJGQ2ZtzQB/WYQNk4H3zqYZv/SYA I/6k0s7HEDiuv3rkcbTFMprnkdO2zfMgYXWwbFsQcU4i+iSawNnb7PVU+RUPXSozwJl2fMxOkOLtF j6ZEO7C3T2+SLBMYZRwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj4Yo-0006iR-C7; Mon, 14 Jan 2019 15:53:58 +0000 Received: from mail-lf1-f67.google.com ([209.85.167.67]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj4Yc-0006ZQ-FR for linux-riscv@lists.infradead.org; Mon, 14 Jan 2019 15:53:49 +0000 Received: by mail-lf1-f67.google.com with SMTP id a16so15963069lfg.3 for ; Mon, 14 Jan 2019 07:53:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZITMFUMV0zEIamJ3VVbE4heK6bK4WYzVzsFXzCFVH0=; b=EKtv1ZC5Wortu3w8fDi/Eaofghc1drTw0sQrMuhX6K3DNpceWVqNtdprNXWIQ05O5A BOKjfOi+6ig+0RUd6rmSQik/zalWI29vNMZ2OFFH41/fhuDpuq0fkfYuGqT4iSG7mGPO nDi1gOma+ARJ6ZIRuP+XxecI3MtseAknyHec5LQRBA9zTbvjjn4WhKC+qTbplWOoic/9 m458DzSwSzUzLCwSfc/5HUxaGiCPqrQNa8jkxvX7Sk0tNszcd9cTllP//juPC0NVJ5Wi V+z4ZLdaLYUidVdD6cCnOfzLfb68LtHyWqA8rREyfc/M2ImVumVkTvxXXjpZmAs50Eqz mxKg== X-Gm-Message-State: AJcUukdITRjQDDlX5dLa0mD8shbUJdLL1MSaULAjswmqDQwITTTK2gb6 z6W8AoFm3EvTY0SvwvWXJ5oRxDqo55hOBBkpuUbG9A== X-Google-Smtp-Source: ALg8bN74ZQTuDIjsqUhLgFMGYUxSw81lMr9Ia6Rp9LV1zOdpgU9nkrJsrZPjHC4E0QC4PQUfRTidFXCqru+uICR4BPA= X-Received: by 2002:ac2:51af:: with SMTP id f15mr13329880lfk.44.1547481224807; Mon, 14 Jan 2019 07:53:44 -0800 (PST) MIME-Version: 1.0 References: <20190114125903.24845-1-david@redhat.com> <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-8-david@redhat.com> From: Bhupesh Sharma Date: Mon, 14 Jan 2019 21:22:49 +0530 Message-ID: Subject: Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved To: David Hildenbrand X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190114_075346_524577_FC89369E X-CRM114-Status: GOOD ( 20.81 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Michal Hocko , CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Florian Fainelli , AKASHI Takahiro , Laura Abbott , Kristina Martsenko , linux-m68k@lists.linux-m68k.org, Mike Rapoport , linux-mediatek@lists.infradead.org, linux-arm-kernel , Logan Gunthorpe , Linux Kernel Mailing List , Dave Kleikamp , James Morse , Johannes Weiner , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Greg Hackmann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > 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 LGTM, so: Reviewed-by: Bhupesh Sharma _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2039CC43387 for ; Mon, 14 Jan 2019 15:53:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9511206B7 for ; Mon, 14 Jan 2019 15:53:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9511206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 81A9D8E0009; Mon, 14 Jan 2019 10:53:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A36A8E0002; Mon, 14 Jan 2019 10:53:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66D8C8E0009; Mon, 14 Jan 2019 10:53:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by kanga.kvack.org (Postfix) with ESMTP id E7A0C8E0002 for ; Mon, 14 Jan 2019 10:53:46 -0500 (EST) Received: by mail-lj1-f197.google.com with SMTP id z5-v6so5606076ljb.13 for ; Mon, 14 Jan 2019 07:53:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:mime-version :references:in-reply-to:from:date:message-id:subject:to:cc; bh=wZITMFUMV0zEIamJ3VVbE4heK6bK4WYzVzsFXzCFVH0=; b=V784TSfn0ALfEjoCyOgtJrVEyLBxeVEXGsX0E4F+PORhGCi3OoE0YdrvWAtNBTyMKb 4LnsG9T01P+jIOu+pjZth43MfyuKN5fVVk0H/Px9+H2X6e3CcuZ7RJlKoy7VKtiTNuCc 1LuWEWaA5z/L+qvdOd8JQG2PiGNWkwnmunwGBCm9Wb4zB+2HBngyNt7v7CX58v2C/IXz wa65CMw51beBLXxCk1kTTi0LTrP5ZbWksIeMbfHRWcrvwNjLiBpi7w0jjpjnF3pZ+ytx pcpPammcIY8C2VVq/a72ih05I4mVzx9f3Qz1plRVLELHTYAviXn/rY/+QYomI7khVR25 EcvA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of bhsharma@redhat.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=bhsharma@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AJcUukeXK5u8ZdsGVRt61Fu4mjxN55MOhvm4H4kSwZ1M5+BXAA61Vpbv pjYUKFQJupn/xugL/yX4gSb3Ad+WhdgTRlpXZ6AQ1j7Kd5L4SXHclI5cs/XEdOJWLb7WygISEdZ my5FNaLeY47TSzJ1Vjb2CiHOpf4vtWoZ0o7NkYP1WrBBN5eTgPCtrDKbU+noja2G0s9VSu6ayc7 7HV00hcwOi5qhFb+FpPtpmGEMumPZOY2cmNcAVkY8EckGoEk4cbUhWtWVfHR/UENcVnyTbEVEMe j1tkqTbZej9OPBvgYmyMii9aoQndusg3i/B10Bf8Tx8e8Q/+n+vygwL/x9eya95a7lK4wcyepGr Dqf6yHz+OumDvnm70O6xVnMwHIe1hHbdjTn1PU+DpaL1ISVcLLVirRwlFfB0obQVQMBEtkNt117 l X-Received: by 2002:ac2:42c5:: with SMTP id n5mr7283669lfl.115.1547481226286; Mon, 14 Jan 2019 07:53:46 -0800 (PST) X-Received: by 2002:ac2:42c5:: with SMTP id n5mr7283626lfl.115.1547481225419; Mon, 14 Jan 2019 07:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547481225; cv=none; d=google.com; s=arc-20160816; b=jXYPHphXoag5+UiLNraGFMR4wiOo7Jkk+/YRxgXUfDF8a2RbLjlrown6hQZwazxivT CxRbf3Umu9jxx/Z9p/EjQdMU5NBHCXCvvmx0qYzxcHQZC/CA0PM1rmT47H0bbxezYcMi dZntrDUyU75s98eaDCts1AwoZ99+0SrtxJnmX/GGkd8qKMrbXZq2HBAV8KBLNBJ0myqw n6XoDRATxgFY2VBDNsYpPt/pPX0E8TZXL3XhH1keZial3nF8fqlaCfevy0Y/U0GNTL3y NvhQl5We7ZabQ7yohR9xQt+6mM05nRJ1sjWTeAINKm8xZ0s5Ws7KO/Kcv7/Q6SXOezi6 zoPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=wZITMFUMV0zEIamJ3VVbE4heK6bK4WYzVzsFXzCFVH0=; b=SUxuU58EDJ2ubxoRt96ACkabNNzLgcMtkpqTinWTSzJXTIBUSmgvAZsJEAmnAKbnc7 Npuxy9hjQErJp6yb2X5mx24+iImx4JZKDAmSFDRYxGKErs2a8eZSkuVaaSlU9LUGBD3a EtwTwaQ8SJAFsnLzBLjLGP3ZgYSvLSkRFnt7xBAJCFkXX2y0qt4OYXTyyH3Qxg51E2WQ oEP4ZItJSXLuNElAn2zD1QSEjb1LtjS1zWmVptze4WEam9UR7IieXXKI0bthYQmbfZF3 +RDPZFLq8CMuWV7nQbCLrK2r9lF+6Q10xa3wI/t6Tk9nB/hWR7JdolcLrCj4W9Um5ecO ADnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of bhsharma@redhat.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=bhsharma@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j188sor272350lfj.72.2019.01.14.07.53.45 for (Google Transport Security); Mon, 14 Jan 2019 07:53:45 -0800 (PST) Received-SPF: pass (google.com: domain of bhsharma@redhat.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of bhsharma@redhat.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=bhsharma@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Google-Smtp-Source: ALg8bN74ZQTuDIjsqUhLgFMGYUxSw81lMr9Ia6Rp9LV1zOdpgU9nkrJsrZPjHC4E0QC4PQUfRTidFXCqru+uICR4BPA= X-Received: by 2002:ac2:51af:: with SMTP id f15mr13329880lfk.44.1547481224807; Mon, 14 Jan 2019 07:53:44 -0800 (PST) MIME-Version: 1.0 References: <20190114125903.24845-1-david@redhat.com> <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-8-david@redhat.com> From: Bhupesh Sharma Date: Mon, 14 Jan 2019 21:22:49 +0530 Message-ID: Subject: Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved To: David Hildenbrand Cc: linux-mm@kvack.org, Linux Kernel Mailing List , linux-arm-kernel , 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, Catalin Marinas , Will Deacon , James Morse , 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 Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Message-ID: <20190114155249.uuvkR4B5c22dK_4K6hgSBciphFGN_-B-Jmme9bVXj_o@z> Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > 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 LGTM, so: Reviewed-by: Bhupesh Sharma From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC374C43387 for ; Mon, 14 Jan 2019 15:55:45 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32CFC206B7 for ; Mon, 14 Jan 2019 15:55:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32CFC206B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43ddNb15W3zDqWH for ; Tue, 15 Jan 2019 02:55:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=209.85.167.67; helo=mail-lf1-f67.google.com; envelope-from=bhsharma@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43ddLN1R0zzDqW7 for ; Tue, 15 Jan 2019 02:53:47 +1100 (AEDT) Received: by mail-lf1-f67.google.com with SMTP id z13so15936831lfe.11 for ; Mon, 14 Jan 2019 07:53:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZITMFUMV0zEIamJ3VVbE4heK6bK4WYzVzsFXzCFVH0=; b=mrE2Ieb902oQLoD6xqT30zPFSVMeVPzpaH+MrQOrxk+LyKSUtzxsKMY2UhMyb7i8Eh XUvN+7N4EgezfQOS7yBV83Or87NG8tVrmNxO2j0kBkC75yvjmUxGJG+S+fK/kS6PgwVR qmhaWd3+0VoKXqDVEIZ2A8PuPwCOd6hlp99lBANVPs5bTu0ihDbIAYczsn/osEuKzD+b Q6X34t5zMjbRiZxppZdz8HHS8oF5DDdtXNLNEVNz4pY+WRdgiRYAwOqqGofXt/XM4LJI e+0q7dLEOlyTk1J0C338/VMvDNo+qT/Ufh0o/XZP2mC2tkeU1mxbeSrCFYtOY2v2P/zh yyKw== X-Gm-Message-State: AJcUukft+GkDDbh9z6xXnF2YKMNNZXga5+757fsIjBtx2NSN+/nYfEJA M85PoOHCpTspvMzGUpwCVsLUaV3HV70HnjNlucG/jw== X-Google-Smtp-Source: ALg8bN74ZQTuDIjsqUhLgFMGYUxSw81lMr9Ia6Rp9LV1zOdpgU9nkrJsrZPjHC4E0QC4PQUfRTidFXCqru+uICR4BPA= X-Received: by 2002:ac2:51af:: with SMTP id f15mr13329880lfk.44.1547481224807; Mon, 14 Jan 2019 07:53:44 -0800 (PST) MIME-Version: 1.0 References: <20190114125903.24845-1-david@redhat.com> <20190114125903.24845-8-david@redhat.com> In-Reply-To: <20190114125903.24845-8-david@redhat.com> From: Bhupesh Sharma Date: Mon, 14 Jan 2019 21:22:49 +0530 Message-ID: Subject: Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved To: David Hildenbrand Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Michal Hocko , CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Florian Fainelli , AKASHI Takahiro , Laura Abbott , Kristina Martsenko , linux-m68k@lists.linux-m68k.org, Mike Rapoport , linux-mediatek@lists.infradead.org, linux-arm-kernel , Logan Gunthorpe , Linux Kernel Mailing List , Dave Kleikamp , James Morse , Johannes Weiner , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Greg Hackmann Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > 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 LGTM, so: Reviewed-by: Bhupesh Sharma From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bhupesh Sharma Subject: Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved Date: Mon, 14 Jan 2019 21:22:49 +0530 Message-ID: References: <20190114125903.24845-1-david@redhat.com> <20190114125903.24845-8-david@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190114125903.24845-8-david@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: David Hildenbrand Cc: linux-mm@kvack.org, Linux Kernel Mailing List , linux-arm-kernel , 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, Catalin Marinas , Will Deacon , James Morse , Mark Rutland , Dave Kleikamp , Andrew Morton , Mike Rapoport , Michal Hocko , Florian Fainelli , Stefan Agner , Laura Abbott , Greg Hackmann J List-Id: linux-mediatek@lists.infradead.org Hi David, On Mon, Jan 14, 2019 at 6:30 PM David Hildenbrand wrote: > > 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 LGTM, so: Reviewed-by: Bhupesh Sharma