From patchwork Fri Dec 14 11:10:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10730885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E7AF15A6 for ; Fri, 14 Dec 2018 11:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F1562D40B for ; Fri, 14 Dec 2018 11:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D02D2D412; Fri, 14 Dec 2018 11:11:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC0A22D419 for ; Fri, 14 Dec 2018 11:11:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF92A8E01C5; Fri, 14 Dec 2018 06:11:14 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D826A8E01D1; Fri, 14 Dec 2018 06:11:14 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5D228E01C5; Fri, 14 Dec 2018 06:11:14 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 93EA48E01C5 for ; Fri, 14 Dec 2018 06:11:14 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id 92so4268656qkx.19 for ; Fri, 14 Dec 2018 03:11:14 -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:from:to:cc :subject:date:message-id:in-reply-to:references; bh=L/mJUv0wuJYz4inTXlhWRsi+v7HJ7aEbISqzOX8ojrc=; b=KrvVE0pAen0pJ2QTX/vGBEA80SOwHTkj+nawqFL0985EAlD/Vnfo7AhEysTr3m/Qmq ihtle2LR4KqOlD4HqOW6WbccukNJLhlcxuj4wkU/VBovrKtPgppLf5eN5cFVcMhc87yF UhqvD/xVB7CFlhyPXOECDoFPkqAwM+Zbm9gc1x/XIL1sS9IFZ4zu/TsJmVJT1rPibGol nxs4SNZUDoIKY6SygAaQ7Q9UpyqCr0z1ILskHeQAqyxm0uMi4osF+VH6pMFcdXgdg8IA fylNiru2Ug0YqhYhjbKme5jfDAo42K503fEiBanAaruKkJNeFvkcebNMn6CB/O9RLaa8 JjHA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AA+aEWYHuCicWlfMEQW1RnW8bYWjAqxkODp4bhbSqrXDRtEV0w5I6Z7L NeLeyIdcpkHCkc9to9ln0dj8zhfXoPUg1PmMBZ3Q/7hhjIBrEyhx2sp+FqG7O+vyeD7wCHjOlGh PGo52ZxDvssIKQkVtT5QQUuC9GwRw1lh48bqbovaI8sj31vFsULwqOBvLqpy3EeXzXw== X-Received: by 2002:a0c:9927:: with SMTP id h36mr2187621qvd.171.1544785874380; Fri, 14 Dec 2018 03:11:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjljbzOU8jxsoPtd47rvtb/0BDfKo3AqRCDSZHs4e4Xr+o5JwhoQNDgSFn8Mc9bbeLegc6 X-Received: by 2002:a0c:9927:: with SMTP id h36mr2187587qvd.171.1544785873866; Fri, 14 Dec 2018 03:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544785873; cv=none; d=google.com; s=arc-20160816; b=WoxiV6khlwnLUPkEnwhsZ21+aXzeIM/lRrz8OvLbrrIK8ITxMvPRkJGwaISSlOdMGc Cqm5xZLglRMiJH4mEIgG8pAMZSdcrk3aN3wtRn+pdyGl5fm5vE5Po+NtV3Li4lfTaklc SMY+RU9kvZixJy1NVlZJzrnKxYGZWPP0H4nBhdSEIo5f/pSEFH9yNmRZGuOFLd4KxrJ2 2kMr1pQiLJqJfCsvZGEjBC9A9dj18BwhQnnpCvoEFXvFpsBE0aDkuInMLHqIqXW+n2bF X8NOcjPnEy3+qceV/d3IAcLraKoJHGnfgMJjyYcE2f7RElNd5yD5jcZL7trzsguqRzpd jEDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=L/mJUv0wuJYz4inTXlhWRsi+v7HJ7aEbISqzOX8ojrc=; b=AZQ/OyD4E/iPn76VSdxaZvuOseig8o/Zwcxv8QoPdR5eflhtSolAOGN4r9QisO00pU cipGVre456uDG5YgV+cy49xUW+7kZtCImApJDHfrk8XF3DGWnXwiM+yyxdBnpeEt9CSQ 9b9rUCkluZdnoiXBD/4PJZt/Mp9f3dF9itCLfYUKXMoTXx4Qh2R0DKPJlupvyYt/P1mt avyVsGS72JxWJp4Ur7JG6cv9ykswCgVu8n/ZUncyzxqcX98/44Bx2huhRPobTwBAY56V 0u3ITSJ2QmrLuBS2GNSMOgbfnobbE/cdsXYhweN11MKQoYc0ibPbN9CRA2/ONjkODnc2 lbWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 126si894299qkh.155.2018.12.14.03.11.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 03:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5AFB8B10A; Fri, 14 Dec 2018 11:11:12 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-139.ams2.redhat.com [10.36.117.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5356017C6F; Fri, 14 Dec 2018 11:11:07 +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 v1 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved Date: Fri, 14 Dec 2018 12:10:12 +0100 Message-Id: <20181214111014.15672-8-david@redhat.com> In-Reply-To: <20181214111014.15672-1-david@redhat.com> References: <20181214111014.15672-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 14 Dec 2018 11:11:13 +0000 (UTC) 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: X-Virus-Scanned: ClamAV using ClamSMTP 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 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 a8f2e4792ef9..9dcfa809b7ab 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); /*