Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3664426pxf; Mon, 22 Mar 2021 11:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjEFP+10NBmlC6XnrTeoGqocscu07avw1GYiQH8dplGFwfACYjhBkstKu07qNSrS24js4t X-Received: by 2002:a05:6402:1d33:: with SMTP id dh19mr1027265edb.362.1616439058371; Mon, 22 Mar 2021 11:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616439058; cv=none; d=google.com; s=arc-20160816; b=al9+Sd4X+oNPIXY7wF3ex8laFxuIRNuvPLjLf3keEauEk6O7qmBYv4DHJSOjVN+Iqn X4vDzK+7VfC1h134saRrXFMINAZQD3zNyHuMnf9lEj6H2Al1I8qWdhmDLMZ6TeQ+hQ1W khxFtRagRPCEIkzeJkUoB5B7E1VSsbsX+ubDA/28fobuPfmLOmiAYTXoHZk6tviggfIY fbwZSsduDyFnO4chlMNBgsohRwP38KwOYmAmpP4SfUGeMkxt+svAJdF7jLtowcIBAskQ BVHk3JihI9ERaASvSIp6Pb1eiX22albpFmJ7RmQAAwhspusTjIWmmeaWe/3SyMevdCyU 3VGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :date:cc:to:from:subject:message-id; bh=fOJrF3FkXdPlboa//q6yDJvDW67x9o4hupgqEIVD7d0=; b=CoW5bS5kX0pgqxs+uhJg3Y7Fo1SuBxwtDzTdW19zX9vWZrCC9xcIZ3WV8lukE2W7bA sIh4ZHFFi5YSnQSTDbRRqkEHACLB/rGHnlFzjffsy2WzSa03eedCgJ+wvTzlWpqCBjtA i5cKao2+wd/zI/ffZA5xLRqZFBl+3UHNHE1TAMOou8CRZwpiGzLb23+jhmHaeLGouVJ1 B1jJid0L5NDsXUesCnIGl2+KBwGLt+fZD2ws7rb1i5EWDi7WblywHClAInemR2FNTdRK Dcr9kNB/B1uNmdgUuhtrm6BboSkZSEF7UwFutCBLkHK5oDV7MNlRgdirToMzhBU1KxNE lllA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb26si12436139ejb.144.2021.03.22.11.50.35; Mon, 22 Mar 2021 11:50:58 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbhCVStU (ORCPT + 99 others); Mon, 22 Mar 2021 14:49:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:59628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbhCVSsq (ORCPT ); Mon, 22 Mar 2021 14:48:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D087DAD80; Mon, 22 Mar 2021 18:48:44 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3 2/2] arm64: mm: reserve CMA and crashkernel in ZONE_DMA32 From: Nicolas Saenz Julienne To: Jon Masters , catalin.marinas@arm.com, linux-kernel@vger.kernel.org Cc: Qian Cai , Will Deacon , linux-arm-kernel@lists.infradead.org Date: Mon, 22 Mar 2021 19:48:43 +0100 In-Reply-To: References: <20191107095611.18429-1-nsaenzjulienne@suse.de> <20191107095611.18429-3-nsaenzjulienne@suse.de> <4f094513-507d-566d-a0e2-a30ea36f64c9@jonmasters.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-9iHYFcF7AG5JS/g9N0on" User-Agent: Evolution 3.38.4 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-9iHYFcF7AG5JS/g9N0on Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2021-03-22 at 14:40 -0400, Jon Masters wrote: > On 3/22/21 2:34 PM, Jon Masters wrote: > > Hi Nicolas, > >=20 > > On 11/7/19 4:56 AM, Nicolas Saenz Julienne wrote: > > > With the introduction of ZONE_DMA in arm64 we moved the default CMA a= nd > > > crashkernel reservation into that area. This caused a regression on b= ig > > > machines that need big CMA and crashkernel reservations. Note that > > > ZONE_DMA is only 1GB big. > > >=20 > > > Restore the previous behavior as the wide majority of devices are OK > > > with reserving these in ZONE_DMA32. The ones that need them in ZONE_D= MA > > > will configure it explicitly. > > >=20 > > > Reported-by: Qian Cai > > > Signed-off-by: Nicolas Saenz Julienne > > > --- > > > =C2=A0 arch/arm64/mm/init.c | 4 ++-- > > > =C2=A0 1 file changed, 2 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > > > index 580d1052ac34..8385d3c0733f 100644 > > > --- a/arch/arm64/mm/init.c > > > +++ b/arch/arm64/mm/init.c > > > @@ -88,7 +88,7 @@ static void __init reserve_crashkernel(void) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (crash_base =3D=3D 0) { > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Current arm= 64 boot protocol requires 2MB alignment */ > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 crash_base =3D memblock_f= ind_in_range(0, ARCH_LOW_ADDRESS_LIMIT, > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 crash_base =3D memblock_f= ind_in_range(0, arm64_dma32_phys_limit, > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 crash_size, SZ_2M); > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (crash_base= =3D=3D 0) { > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 pr_warn("cannot allocate crashkernel (size:0x%llx)\n", > > > @@ -454,7 +454,7 @@ void __init arm64_memblock_init(void) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 high_memory =3D __va(memblock_end_of_D= RAM() - 1) + 1; > > > -=C2=A0=C2=A0=C2=A0 dma_contiguous_reserve(arm64_dma_phys_limit ? := =20 > > > arm64_dma32_phys_limit); > > > +=C2=A0=C2=A0=C2=A0 dma_contiguous_reserve(arm64_dma32_phys_limit); > > > =C2=A0 } > > > =C2=A0 void __init bootmem_init(void) > >=20 > > Can we get a bit more of a backstory about what the regression was on= =20 > > larger machines? If the 32-bit DMA region is too small, but the machine= =20 > > otherwise has plenty of memory, the crashkernel reservation will fail.= =20 > > Most e.g. enterprise users aren't going to respond to that situation by= =20 > > determining the placement manually, they'll just not have a crashkernel= . >=20 > Nevermind, looks like Catalin already changed this logic in Jan 2021 by= =20 > removing arm64_dma32_phys_limit and I'm out of date. Also see this series (already merged): https://lore.kernel.org/linux-arm-kernel/20201119175400.9995-1-nsaenzjulien= ne@suse.de/ Regads, Nicolas --=-9iHYFcF7AG5JS/g9N0on Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAmBY5osACgkQlfZmHno8 x/5wPAf/WA4vj1kbrX0NtO4qTprFN/IA4jdplzDtN3CTgiXbuscV6xJjsbby0l7B aq73lCWc7WDGlUdg92a3tBc3VwcAngl2Hl/HwSD36Gj1EHkFzF0BY/AGgs6sy7FI 4vQk/EjKja5Wqe9OI9urmoP0J6hgcreNaROxldg0NzGH5iop/sdX5T7PtBK6yO1D YKarQbCuke2PP5CTJzfKDaaJ7kuXQWCe7bBlrlKbqZftZbd68DbHD0Viis5A5Wfj sny7asDVXjiVWEX688VANHnAeUnJJprPheU67vTlD9n8tqRxqpmEeDvE3V3clph3 QFCQLxKnmArwDaHhNM3raRFLJphGkw== =M3gO -----END PGP SIGNATURE----- --=-9iHYFcF7AG5JS/g9N0on--