Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7589640ybi; Thu, 1 Aug 2019 10:27:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEAkp9pA3TmyUdX6+fLTXniNUpZvwbKW+hIPXh7A7BMOkt2eiXSgAK1ZArqy39EJCnmaaz X-Received: by 2002:aa7:95bb:: with SMTP id a27mr55907056pfk.229.1564680456948; Thu, 01 Aug 2019 10:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564680456; cv=none; d=google.com; s=arc-20160816; b=btjGqfu5gmY81WoVmdDEgC8HJHOMbDCp8+5bVXyJYAoAlFqeiDbfo9TIAXMA1Qful2 8oejkHz9PFv1Gm+82BgJ2zY7BpwEOZGP0QwPRFw4eTb2u2mPJVOWN10HQB2Xgz3bnvR+ Q3Qlh71WqYd2YZT5mvGUW5cfohJQ/Zs97QVNvW2r3LqGYJ/fHyGWQjTyAUf+e9rQ4azH zWiLNDwHF5fqGD0yHoGiMXU/5YqzjA7WouvQyjHagd/Zf7Uu3EJbbZrawrssSbKVJraW xG75gBsjyuVKV3Mv33jq9BkbEOUJ8SggCG01Z9Y7wQRQ1o8PMZIQy0nAB1ReqWnvNd9J dYTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=b40JMKpT5Z3tutjA7zuOzYM9A1Cnzw5E6joM5yEKgLI=; b=lXLqVr+ntZOKh2EStUcwltSqldGxWoARl+8PtiHI/8+v4SLe/OVedPByYCSNbTtUoz zt+MbwDbdyDkrltV6xHCn8ERPNL6TSbuBhCuNt5cphMWGWo3Gin0TJbOYuglcZQai3p7 x0S664v9l7x124u/CLaSvlsvn5NwdZO57DfWQsOC/O+g9Ja7vwMcjXbxktEF5Qmb138B 3oSJjc5mlqwPN9nKfweroC5HqoY5QVB4cSn+oYDqQu5UTc8ZgHyqjxC1XBFIK45OqE4p N/KtiXIGftQ9ng9th5U9ZrEcFlW+PR49NTaj+LusAyQeMjhZh9g5rDVlM4xsgXEPDCd/ XSwQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n20si34213818plp.395.2019.08.01.10.27.20; Thu, 01 Aug 2019 10:27:36 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729609AbfHAPov (ORCPT + 99 others); Thu, 1 Aug 2019 11:44:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:42190 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728414AbfHAPov (ORCPT ); Thu, 1 Aug 2019 11:44:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 222CDAC9A; Thu, 1 Aug 2019 15:44:50 +0000 (UTC) Message-ID: Subject: Re: [PATCH 5/8] arm64: use ZONE_DMA on DMA addressing limited devices From: Nicolas Saenz Julienne To: Catalin Marinas Cc: phill@raspberryi.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, f.fainelli@gmail.com, frowand.list@gmail.com, eric@anholt.net, marc.zyngier@arm.com, Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, robh+dt@kernel.org, wahrenst@gmx.net, mbrugger@suse.com, akpm@linux-foundation.org, Robin Murphy , hch@lst.de, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com Date: Thu, 01 Aug 2019 17:44:09 +0200 In-Reply-To: <20190731170742.GC17773@arrakis.emea.arm.com> References: <20190731154752.16557-1-nsaenzjulienne@suse.de> <20190731154752.16557-6-nsaenzjulienne@suse.de> <20190731170742.GC17773@arrakis.emea.arm.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-Jl/nDcfVAied7u8Yssfo" User-Agent: Evolution 3.32.4 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-Jl/nDcfVAied7u8Yssfo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-07-31 at 18:07 +0100, Catalin Marinas wrote: > On Wed, Jul 31, 2019 at 05:47:48PM +0200, Nicolas Saenz Julienne wrote: > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > > index 1c4ffabbe1cb..f5279ef85756 100644 > > --- a/arch/arm64/mm/init.c > > +++ b/arch/arm64/mm/init.c > > @@ -50,6 +50,13 @@ > > s64 memstart_addr __ro_after_init =3D -1; > > EXPORT_SYMBOL(memstart_addr); > > =20 > > +/* > > + * We might create both a ZONE_DMA and ZONE_DMA32. ZONE_DMA is needed = if > > there > > + * are periferals unable to address the first naturally aligned 4GB of= ram. > > + * ZONE_DMA32 will be expanded to cover the rest of that memory. If su= ch > > + * limitations doesn't exist only ZONE_DMA32 is created. > > + */ >=20 > Shouldn't we instead only create ZONE_DMA to cover the whole 32-bit > range and leave ZONE_DMA32 empty? Can__GFP_DMA allocations fall back > onto ZONE_DMA32? Hi Catalin, thanks for the review. You're right, the GFP_DMA page allocation will fail with a nasty dmesg erro= r if ZONE_DMA is configured but empty. Unsurprisingly the opposite situation is = fine (GFP_DMA32 with an empty ZONE_DMA32). I switched to the scheme you're suggesting for the next version of the seri= es. The comment will be something the likes of this: /* * We create both a ZONE_DMA and ZONE_DMA32. ZONE_DMA's size is decided bas= ed * on whether the SoC's peripherals are able to address the first naturally * aligned 4 GB of ram. * * If limited, ZONE_DMA covers that area and ZONE_DMA32 the rest of that 32= bit * addressable memory. * * If not ZONE_DMA is expanded to cover the whole 32 bit addressable memory= and * ZONE_DMA32 is left empty. */ Regards, Nicolas --=-Jl/nDcfVAied7u8Yssfo 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/4FAl1DCMkACgkQlfZmHno8 x/724wgAlBvY4KUvCY6AbQ4IkNYytX+x49CEh/vxpdWWXLjrWRTBCg2SwWhZ4y9G OjuuZe9BBgQBgnZBR0lC8MlCFN7w4Ce5aByypx2pzGLefZKqc4pesvda/gC8Jmo8 csbQ988GLPt6V35DcX3N81FjYrdsZGCcJ1XrtpUVlx6YfIPLx4ZRc/6OfV3yXXBc XiD/luxNVqjDtvy7RnR2so9hSWet0hM4Wv5TDwI+xt1RviR4Tpdd+jNqtjxH+LcV 2uruy3yUhTGeNaiyZsPt/Bj1Mlg+Wab940ahUDn3a1KBkd4BkFZIoqfjQxBgLaal iZB+n9PmIhCkaHygfxOy1H+xVYO/AA== =Opde -----END PGP SIGNATURE----- --=-Jl/nDcfVAied7u8Yssfo--