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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 A4807C19759 for ; Thu, 1 Aug 2019 15:44:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80E8D2171F for ; Thu, 1 Aug 2019 15:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729711AbfHAPov (ORCPT ); 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-- 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 0EB01C433FF for ; Thu, 1 Aug 2019 15:44:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8BE92087E for ; Thu, 1 Aug 2019 15:44:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8BE92087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5D42A8E002C; Thu, 1 Aug 2019 11:44:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5853A8E0001; Thu, 1 Aug 2019 11:44:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 474F58E002C; Thu, 1 Aug 2019 11:44:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id EFD688E0001 for ; Thu, 1 Aug 2019 11:44:51 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id f3so45135198edx.10 for ; Thu, 01 Aug 2019 08:44:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:message-id :subject:from:to:cc:date:in-reply-to:references:user-agent :mime-version; bh=b40JMKpT5Z3tutjA7zuOzYM9A1Cnzw5E6joM5yEKgLI=; b=ZTLkx7NyyNB0gzcL9nGa72Hp0XV6KVrbqpwdlczB/qhyGVaO2a/SPfAE1IPrKfXFDF Kz/6aVA7OZVg+1PPca12YjpJ+wtCgTbD9YGBjICbeis3r/inSP6yfT5KSmQWh83oQhoQ KOaRPY+AJ24BRk7e4dBHF4WQ+Uuy58RfTuCJTRU2GSr3zCPeiKjVen3hx1mFLG9KlkL3 jXVBy6fkui+oX/Rkdt31luKP4AvxK3DNEC3kemkBwSD4GBI+9iR49P3efIXfv+FpYo7+ uwQjCZqCOW8FJXuGq+EhHufVyJjauHsXUUttmeoeD2vSlfSouF2EAtPuRBauMtW6TC/b n58w== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=nsaenzjulienne@suse.de X-Gm-Message-State: APjAAAW4tSZAnOs66hWz55HBQxfjzHhQ97RlYPh1vT05Fw1GvWhTIMch wzCMMcbIZqUnfiE5qdN9stf28ndaqM4L9y80034Nmn3yU5a73Vs8d2Ouy8x099idCSRGbDCF6UD E0E6xN2e1dlgYfzMirwadu/TZpdvlwVJgTuX+2znam+gv32dBDdMXw4eL92j1fF1fiQ== X-Received: by 2002:a50:89a2:: with SMTP id g31mr114915460edg.93.1564674291521; Thu, 01 Aug 2019 08:44:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDqQV9zsbyHkIK2XIoC3H0v2FyEeYA5B/GzjdO/tkSYZzB+cMME5nLRJ/o+iFWRCS54MdD X-Received: by 2002:a50:89a2:: with SMTP id g31mr114915399edg.93.1564674290810; Thu, 01 Aug 2019 08:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564674290; cv=none; d=google.com; s=arc-20160816; b=ulFA3BDW41gofFk/bK2SWh2xPdaO23Pb09OuMeUu+d9HHbILlwPayZLQtVm4q17mW8 qTwceefT7oenuGSo9tJuMdcAaQIDi75AvGwFBxSM8uc4i7kr4p/jE07vTtA7NwzDbAa3 mqBeBDWFaVIET2Mpea/qRXHEBVGLBF0dOzTxWjrceim3WwEnmgaZuL9nBRvMk1bF+pLN hymT8a8ze6aAsExxr0n6WYeikgMsACs4c14p6D2G7Z2A+whA+VY7elVXWgeBgswj++m9 BoSYKU6daT06jMJdvKiYHFyido4ItesipcU//UFWLjjFtI5mslCQ/VN2X80wjStA7qbF wgvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id; bh=b40JMKpT5Z3tutjA7zuOzYM9A1Cnzw5E6joM5yEKgLI=; b=x/1TDuHzg3hUBT8eKK98xn8P1/DHNdyJhOzm4DsHFUslacO2Xdy5vT4CVgLTegM+Be QZyZ/stikTWFOAeNoxmxB7AoCud/3LWKgd6pIOKcIGdYcn+b7qWMRse3/sTnkrXnX6pD cHmDPLC6ujD5/IXmTRlzkanBmRKsS/+H9XBNQocNBowI0kcApaVuACu6iSf+sln0+Fy3 yIoNw1BRND4o6cF7m4ADmLEOxzQ0BY8PD00TelbHU5pWoMydyBJZOSwiEFF7ePUZ+QVO rAsUJKl6qhEpCtHp9yamr2p7ZyzNG4tH4f1Za2nWNgW6nBDVuo2TVS1x0oJD45kgMX7T 37OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=nsaenzjulienne@suse.de Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id w23si23934963edw.447.2019.08.01.08.44.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 08:44:50 -0700 (PDT) Received-SPF: pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=pass (google.com: domain of nsaenzjulienne@suse.de designates 195.135.220.15 as permitted sender) smtp.mailfrom=nsaenzjulienne@suse.de 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --=-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-- 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 0C591C19759 for ; Thu, 1 Aug 2019 15:45:25 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (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 DBFBC20644 for ; Thu, 1 Aug 2019 15:45:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBFBC20644 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 98B1E8917; Thu, 1 Aug 2019 15:45:24 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A6878883C for ; Thu, 1 Aug 2019 15:44:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1FA10821 for ; Thu, 1 Aug 2019 15:44:52 +0000 (UTC) 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 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> User-Agent: Evolution 3.32.4 MIME-Version: 1.0 Cc: phill@raspberryi.org, devicetree@vger.kernel.org, f.fainelli@gmail.com, linux-mm@kvack.org, marc.zyngier@arm.com, Will Deacon , linux-kernel@vger.kernel.org, eric@anholt.net, iommu@lists.linux-foundation.org, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, mbrugger@suse.com, Robin Murphy , akpm@linux-foundation.org, frowand.list@gmail.com, hch@lst.de, linux-arm-kernel@lists.infradead.org, wahrenst@gmx.net X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6296479843951571021==" Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org --===============6296479843951571021== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-Jl/nDcfVAied7u8Yssfo" --=-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-- --===============6296479843951571021== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu --===============6296479843951571021==-- 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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 07FAAC19759 for ; Thu, 1 Aug 2019 15:44:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D317120B7C for ; Thu, 1 Aug 2019 15:44:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O23Yi5Cf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D317120B7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Date:To:From:Subject:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dHeUSHK3Rk1uwBxxk4ysRKoK6bYY80xSjmaQ13+cjbs=; b=O23Yi5Cf7i1BS+Jua6MdNaO6R +yeYucg0k/ZKWCPchzcfILjOGbw0BsfK/jihRj8EChBZJ8aaiblWIB0iLrGqKWyzvYHHbbW0HwG1Q Czs3k2ZU/iRgrR/p6skS2Pg6VVbYhsWGM+HzYH0w5MsQCPSj5P7gHex+SD+llmZSytDz5V/JGipj4 jBCmaR/7voZleHMBWm9xJdvwL4wLaO5H7XHlqrKzv4UXviBPy8VCgO9dcDPxkBvaMVZlg4WZuTy+C x8bMXHP2G0EiqF1AYbGCPXS7eFD062vGZDlCLlS6zcRrRTg+A+M8Igq2J1y9m2TTKmZomoFKM/YXY Byq3rAD+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1htDGA-0003Xd-AS; Thu, 01 Aug 2019 15:44:54 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1htDG8-0003W8-40; Thu, 01 Aug 2019 15:44:53 +0000 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 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> User-Agent: Evolution 3.32.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190801_084452_310381_5311C291 X-CRM114-Status: GOOD ( 14.81 ) 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: phill@raspberryi.org, devicetree@vger.kernel.org, f.fainelli@gmail.com, linux-mm@kvack.org, marc.zyngier@arm.com, Will Deacon , linux-kernel@vger.kernel.org, eric@anholt.net, iommu@lists.linux-foundation.org, robh+dt@kernel.org, linux-rpi-kernel@lists.infradead.org, mbrugger@suse.com, Robin Murphy , akpm@linux-foundation.org, m.szyprowski@samsung.com, frowand.list@gmail.com, hch@lst.de, linux-arm-kernel@lists.infradead.org, wahrenst@gmx.net Content-Type: multipart/mixed; boundary="===============4430640618888223044==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4430640618888223044== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-Jl/nDcfVAied7u8Yssfo" --=-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-- --===============4430640618888223044== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4430640618888223044==--