Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3718837imu; Mon, 14 Jan 2019 07:55:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN51sgvJy1G7Ycg7LA+RJwHXb4gJNaKRvbisXA1hXhItbjIHc6ZarrIdhWxaKMYOvVMT9EN5 X-Received: by 2002:a17:902:9691:: with SMTP id n17mr26758557plp.9.1547481334429; Mon, 14 Jan 2019 07:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547481334; cv=none; d=google.com; s=arc-20160816; b=LlXo+N9t5lhzLSfY761bxURTa1RVA6ryFCpcj95GsQCS+ZOYjmZVZWhU8sz8+cRVPn +vOPN8tthHoFsQwQ4Wpe6ERasPSf4v4NUVTlOplh+ONynkVZtgWR3qFjGY/c+xALW0sJ wkkIR2JN4D67NdBVDlMKeazMrtF33AY+Uu+iKjlGqwviZWnRfHYj4dko8E5X1wVBSvv+ T6IkzORt5+KyiDzO7sAWV9KSvYyPchd4WnNyCwZvcP+Rpcr+PksIyQ62+jmsRpwXRwh1 Ky0L71rCQ9cw+m7iac8k5AKBD8d1xV7OvcndBgpEP1LUdJXBNq42o3eC/6dCRVNj4ted X8aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=wZITMFUMV0zEIamJ3VVbE4heK6bK4WYzVzsFXzCFVH0=; b=xWku3Bg+zqi9oRTkSeL/Y+bjbNB8aYRw0CCmIfkQWHglb47hOIDhahl1QX8wJi5sBP 2NqphHNnGTxVwGp/zBT7NMosdjKnbOqKge3/yY/K7oJySAJFCVqDwIrxiGGU70ZfqiMG 3qa8ilWsjkMQc2VXor8xtuyvS7L/zJFlJtWaijUqX2nVmBdO4KzE4eESb7T1uS5fgLqi Be98YKQyCPS2K8X0w/qekYJ4j+JWTu5sLXJNd1c9b64yD/wSB9RXdc5MtEKdcnalFYZZ cRHfArYVXWO2y0tAqFShqo2GEJdcjVER7nwmzYt4HAdx0O3Via4e63UUs6F+Kp6OhW1Q 5ufg== 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 j21si543608pfn.277.2019.01.14.07.55.18; Mon, 14 Jan 2019 07:55:34 -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 S1726750AbfANPxr (ORCPT + 99 others); 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-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