From patchwork Mon Jan 14 12:59:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10762343 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 171AE6C2 for ; Mon, 14 Jan 2019 13:00:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 094042887B for ; Mon, 14 Jan 2019 13:00:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F170D28885; Mon, 14 Jan 2019 13:00:08 +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 89BC92887B for ; Mon, 14 Jan 2019 13:00:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E64F8E000A; Mon, 14 Jan 2019 08:00:06 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 36A6B8E0002; Mon, 14 Jan 2019 08:00:06 -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 233FE8E000A; Mon, 14 Jan 2019 08:00:06 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by kanga.kvack.org (Postfix) with ESMTP id E5FFC8E0002 for ; Mon, 14 Jan 2019 08:00:05 -0500 (EST) Received: by mail-qt1-f199.google.com with SMTP id n50so24564373qtb.9 for ; Mon, 14 Jan 2019 05:00:05 -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=TfVqJzn58+aN73fiEb8YQ9OGV+gvW4QvjxrwkR+KcuU=; b=dsNm5QQX5esHjCw+WIXqBZwkdsdGUb6f1RD5fE45n3iEYuuiCPjLa1XvBz5dQMiAMT +pSJ9YAJGAhu5WZ06vTikYHx/dmUrhhlFul3v3RDqQUyg6GcudJcYBdXFozNVTmj2ie4 KaRPmsgi3RUJuthbqDVlTriWAT6O5ccr3Eh71UVuGBCoxkyZZ9w7E/Stb2DvajqqVxRv QavKqflef4Rvr/7dP54inPpKNEITuJOCGfz30qR049v0no/kVD3Mr5dC47vjyhOa0YgH lXeI945+6yCEAMs/ePD6Zuruvg2sgElGt8YaRq9q97obeRTot2qGU/5CGzWzz6MIukUl 6kuA== 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: AJcUukfqKAoBCrpsUBCFGtj2RwQA2njNxd0SJnO2issA80Q/Up/sR02w ifQHFsgIyXzcq47DPjZiv3DNBBBNPgjb00DQpaZ5nrhZNzvmyQ0TtdVYGErR0CMTIEDeHTGNd4g ysu//sbF+oUUPLOqr9EewnHMEvuTKarGp2LxuYCiQwvjudOnAEr7Tia973wnufsbQLw== X-Received: by 2002:a0c:d124:: with SMTP id a33mr23573214qvh.19.1547470805681; Mon, 14 Jan 2019 05:00:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6fBXAC4TSaQNANGWOU6G53g3l13Y9TQy2G3iatT65KXwtca/NDRZSGgwhGQvbPa7YOQns/ X-Received: by 2002:a0c:d124:: with SMTP id a33mr23573171qvh.19.1547470805150; Mon, 14 Jan 2019 05:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547470805; cv=none; d=google.com; s=arc-20160816; b=rwALsqKcJMQKl2e4nFCGrvkKwGs47znlMPWABAcxiPsjB/1IP8UL90dqcw5XLo/u64 BQUU3QJUAPq24CT2SwiEold1C6HJUx6CYOPEdzkNsVSrKS8i0QuJrgDvOxJmaARVu4Ik pd52JJrO8g74SVij/D7vE2ZL324P3R7cdV9zg7fnfeiSnS59NKo4KJGuBM/N9WTWySdU etEoAKsgfqrrIc0F3HTVk4G2DMmaOfWjOEeFJVjxU2BGkq91puKm+oo1M3BE1iG800/y TWd3e9nqqmpzQ5USyKeIDRUH3XM6NN4tAaHAA5tyRbyFM3CcP/E6H265fz3EbyxgpKsN J9LQ== 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=TfVqJzn58+aN73fiEb8YQ9OGV+gvW4QvjxrwkR+KcuU=; b=xxitxPFpGJ7w/GqaWnQ563f9D08Sy5uO18MrdxnOn6/c+ggIPVNxsh87mTwLCr22IX Io0/tZqn5DOFw4Qyx8sI9YuhaR6jd19w6IOIJrwZ9+cWUmxaiDYIWUosoASZ1QpXAFHa O7iRYgguK81WEqWye/XKSRWINUZgIv+uS51IcTgGCQiDQVrtrrvTM/0xjFL8LbXDWRZr CQR2x6Bq4I3LHYwaYKR5Xrn19jiGFHAF3baT0ttRMVlMa4sczR0Fds4k4lbcHqp9DEPq 2xKMqbDrwEwMA3x5dRvMCozm65/pvn9/vvkgaeYzI88X0cQkdyet93SoW1S9hAcA1vN+ eYbQ== 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 v64si1458846qkh.60.2019.01.14.05.00.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:00:05 -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-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) 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 Reviewed-by: Matthias Brugger Signed-off-by: David Hildenbrand Reviewed-by: Bhupesh Sharma Acked-by: Catalin Marinas --- 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); /*