Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp515353pxu; Thu, 7 Jan 2021 10:36:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTwIhTgNditlAmjiJq9DKnwNunr6dZC4FWVB9nwb05uKETCMK748n3K7eiMMjko4hfW+0q X-Received: by 2002:a50:9dc9:: with SMTP id l9mr2626464edk.377.1610044560345; Thu, 07 Jan 2021 10:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610044560; cv=none; d=google.com; s=arc-20160816; b=lPMv5SFkf/NAP49kDmZE2TwpTjQ9Lv+SHm/Xif3ccmjrCtBBWaFxhEQxp8dVjPOgca pgM5LdrleRPk2iEA+ZACp1bpx8ZbUmhll078hY1dU71E7C/fWcE7vWocGGHyRa7pwRS1 qxgO3Nv2G/I3YsC9DpB0lN158X+/UsBjVQXMw5WVO1v3lXdt2xWNEgT9X1bgEEPzcWGn ylQImTMKQKKcqCksSIjbxuNOuwv1cPSgfSugqQeR1EJCwKDtfBYeqv9n5u8RnGEg0RKb r/RouM67v1IrIaG7t2l+nJfgsiGQ6763e4uWady4n1WR7jOhGa08hT6DetLSXeVqimdT v3kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Q4N+KurCZb05cTw6fHB69/OfGOBpP1VFWmNPN8VakSk=; b=rTmFaAzmG7HZPXQCjepuMcDU/Pme+kbO+VyrRZIcA35n5N6pxcKxM/u6nB9uIHz/Gs Zq6bBgoWtUVjeLsQ7ljs0s3O8JuhuQchGmbDKqnF0/lx+SInknnGBMV3qd8wjiv70sLE Wc71/60RLbKaOAr73oWnIUbVhtJKzCsyQ5rRSbDKU2G96RDTVsdWT+s2d635RdEDkzGB HwOfW8TmSL3FTuyVNRqSA732EBP+scrqR0FU23Mibil5G/B0XDOoS3KDh/hC8ZziFQlw UznV3VKd5SclGHrhrwjINtoOt9Hrzsk1C4ZNYWIaRgzvnHKF8RG23XP0MWuSL60hAAGh 7kOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si2644133ejr.308.2021.01.07.10.35.37; Thu, 07 Jan 2021 10:36:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726427AbhAGSeq (ORCPT + 99 others); Thu, 7 Jan 2021 13:34:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:37542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725835AbhAGSeq (ORCPT ); Thu, 7 Jan 2021 13:34:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DEFED233CF; Thu, 7 Jan 2021 18:34:03 +0000 (UTC) Date: Thu, 7 Jan 2021 18:34:01 +0000 From: Catalin Marinas To: chenzhou Cc: Nicolas Saenz Julienne , will@kernel.org, ardb@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, song.bao.hua@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, huawei.libin@huawei.com, xiexiuqi@huawei.com Subject: Re: [PATCH 2/2] arm64: mm: fix kdump broken with ZONE_DMA reintroduced Message-ID: <20210107183400.GB26159@gaia> References: <20201226033557.116251-1-chenzhou10@huawei.com> <20201226033557.116251-3-chenzhou10@huawei.com> <653d43ed326e6a3974660c0ca2ad8a847a4ff986.camel@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 28, 2020 at 03:32:35PM +0800, chenzhou wrote: > On 2020/12/26 18:34, Nicolas Saenz Julienne wrote: > > On Sat, 2020-12-26 at 11:35 +0800, Chen Zhou wrote: > >> If the memory reserved for crash dump kernel falled in ZONE_DMA32, > >> the devices in crash dump kernel need to use ZONE_DMA will alloc fail. > >> > >> Fix this by reserving low memory in ZONE_DMA if CONFIG_ZONE_DMA is > >> enabled, otherwise, reserving in ZONE_DMA32. > >> > >> Fixes: bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in ZONE_DMA32") > > I'm not so sure this counts as a fix, if someone backports it it'll probably > > break things as it depends on the series that dynamically sizes DMA zones. > > I write this just because kdump is broken from this commit. Commit bff3b04460a8 actually fixed a regression introduced by the limited 30-bit ZONE_DMA, under the assumption that RPi4 is the only platform that cares about this. I agree a kdump kernel will fail to get memory in the low zone but it's not clear to me whether the regression you are seeing happened in 5.11-rc1 or you it's been around since 5.5. We may have got away before because max_zone_phys() assumed an implicit DMA offset equal to the start of the DRAM (well, power of two). This assumption was removed in 5.11 by commit 791ab8b2e3db ("arm64: Ignore any DMA offsets in the max_zone_phys() calculation"). So your patch or the clean-up I posted only makes sense with the dynamic ZONE_DMA patches in 5.11-rc1. For any earlier version, I don't have any suggestion other than not enabling CONFIG_ZONE_DMA in the kdump kernel (or backporting all of Nicolas' patches). I'll post my clean-up separately to go into 5.11 but won't have a fixes tag for bff3b04460a8. -- Catalin