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.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 90263C433E0 for ; Thu, 2 Jul 2020 07:51:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 5F9D920899 for ; Thu, 2 Jul 2020 07:51:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OMW5gNgq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="1tzmwO6b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F9D920899 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JzTVZbAZ6kD3awb/EjjCqvYdGHO/gtRAF8JMsacVej0=; b=OMW5gNgqKn/J1JeQf9/CDTctE /Hr6KyJVIkoarnx/QLVDbmDgrrvaPIURE6MKTNBzwCGYcypEUOc0axSR2bIyTRmDM4S9hqfSPafaU tCBF5FKYrZ7JXqgombDifx2sdyCIovNnr13JN5vYRn7aDX8hN9NS5ynN3vMgp2Bmoz8Rh8cOhzFm4 aHfj0rMn6yhJuP+0SZWjmNIDKLLU+vbIKeXdc+RD6vlmi3cs+/gP/0vt2uRYAzond2MiMoH5YzEz4 qD0n+3MujReZGD0sk0Aqop+CtF0lP/ZlSeqcaexMR9FPe87KmZfqqxH/Afy2ZiDDggZJhlAnghRK8 Fg1CXM2WA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqtz7-0001wF-1W; Thu, 02 Jul 2020 07:50:17 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqtyy-0001qZ-LS; Thu, 02 Jul 2020 07:50:10 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F9EB20936; Thu, 2 Jul 2020 07:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593676207; bh=OPwzfImFs/6d/wxmTj/SDF/k3f/jGxD4d+RjrzyjUhY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1tzmwO6bBgv8e1nwdoCor7eoYs88C56cCi+b1LCWxsslV3Obsc9H5N3DTD0s4kOVb nkn4R3y7DQPj5Agqp5PfpNJs4ca/7dhafI+z0F6Kcb9Mkvdl0vYkOTgV86DU6NajuG s2sQPFWem5d6mVKrB7CLIcoWue9AxNGe9AlfXe3E= Date: Thu, 2 Jul 2020 08:50:02 +0100 From: Will Deacon To: Bhupesh Sharma Subject: Re: [PATCH 2/2] arm64: Allocate crashkernel always in ZONE_DMA Message-ID: <20200702075001.GA16113@willie-the-truck> References: <1593641660-13254-1-git-send-email-bhsharma@redhat.com> <1593641660-13254-3-git-send-email-bhsharma@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1593641660-13254-3-git-send-email-bhsharma@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200702_035008_893515_86CF5367 X-CRM114-Status: GOOD ( 21.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Hocko , linux-mm@kvack.org, James Morse , Vladimir Davydov , Johannes Weiner , cgroups@vger.kernel.org, bhupesh.linux@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 02, 2020 at 03:44:20AM +0530, Bhupesh Sharma wrote: > commit bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in > ZONE_DMA32") allocates crashkernel for arm64 in the ZONE_DMA32. > > However as reported by Prabhakar, this breaks kdump kernel booting in > ThunderX2 like arm64 systems. I have noticed this on another ampere > arm64 machine. The OOM log in the kdump kernel looks like this: > > [ 0.240552] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations > [ 0.247713] swapper/0: page allocation failure: order:1, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0 > <..snip..> > [ 0.274706] Call trace: > [ 0.277170] dump_backtrace+0x0/0x208 > [ 0.280863] show_stack+0x1c/0x28 > [ 0.284207] dump_stack+0xc4/0x10c > [ 0.287638] warn_alloc+0x104/0x170 > [ 0.291156] __alloc_pages_slowpath.constprop.106+0xb08/0xb48 > [ 0.296958] __alloc_pages_nodemask+0x2ac/0x2f8 > [ 0.301530] alloc_page_interleave+0x20/0x90 > [ 0.305839] alloc_pages_current+0xdc/0xf8 > [ 0.309972] atomic_pool_expand+0x60/0x210 > [ 0.314108] __dma_atomic_pool_init+0x50/0xa4 > [ 0.318504] dma_atomic_pool_init+0xac/0x158 > [ 0.322813] do_one_initcall+0x50/0x218 > [ 0.326684] kernel_init_freeable+0x22c/0x2d0 > [ 0.331083] kernel_init+0x18/0x110 > [ 0.334600] ret_from_fork+0x10/0x18 > > This patch limits the crashkernel allocation to the first 1GB of > the RAM accessible (ZONE_DMA), as otherwise we might run into OOM > issues when crashkernel is executed, as it might have been originally > allocated from either a ZONE_DMA32 memory or mixture of memory chunks > belonging to both ZONE_DMA and ZONE_DMA32. How does this interact with this ongoing series: https://lore.kernel.org/r/20200628083458.40066-1-chenzhou10@huawei.com (patch 4, in particular) > Fixes: bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in ZONE_DMA32") > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Vladimir Davydov > Cc: James Morse > Cc: Mark Rutland > Cc: Will Deacon > Cc: Catalin Marinas > Cc: cgroups@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: kexec@lists.infradead.org > Reported-by: Prabhakar Kushwaha > Signed-off-by: Bhupesh Sharma > --- > arch/arm64/mm/init.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 1e93cfc7c47a..02ae4d623802 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -91,8 +91,15 @@ static void __init reserve_crashkernel(void) > crash_size = PAGE_ALIGN(crash_size); > > if (crash_base == 0) { > - /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit, > + /* Current arm64 boot protocol requires 2MB alignment. > + * Also limit the crashkernel allocation to the first > + * 1GB of the RAM accessible (ZONE_DMA), as otherwise we > + * might run into OOM issues when crashkernel is executed, > + * as it might have been originally allocated from > + * either a ZONE_DMA32 memory or mixture of memory > + * chunks belonging to both ZONE_DMA and ZONE_DMA32. > + */ This comment needs help. Why does putting the crashkernel in ZONE_DMA prevent "OOM issues"? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel