From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 44ECE6B74A2 for ; Wed, 5 Dec 2018 08:54:46 -0500 (EST) Received: by mail-pl1-f197.google.com with SMTP id x7so14872988pll.23 for ; Wed, 05 Dec 2018 05:54:46 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id r11si20699098pli.175.2018.12.05.05.54.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 05:54:45 -0800 (PST) Date: Wed, 5 Dec 2018 05:54:06 -0800 From: Christoph Hellwig Subject: Re: [PATCH v4 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging Message-ID: <20181205135406.GA29031@infradead.org> References: <20181205054828.183476-1-drinkcat@chromium.org> <20181205054828.183476-4-drinkcat@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181205054828.183476-4-drinkcat@chromium.org> Sender: owner-linux-mm@kvack.org List-ID: To: Nicolas Boichat Cc: Will Deacon , Robin Murphy , Joerg Roedel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Michal Hocko , Mel Gorman , Levin Alexander , Huaisheng Ye , Mike Rapoport , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yong Wu , Matthias Brugger , Tomasz Figa , yingjoe.chen@mediatek.com, hch@infradead.org, Matthew Wilcox On Wed, Dec 05, 2018 at 01:48:28PM +0800, Nicolas Boichat wrote: > IOMMUs using ARMv7 short-descriptor format require page tables > (level 1 and 2) to be allocated within the first 4GB of RAM, even > on 64-bit systems. > +#ifdef CONFIG_ZONE_DMA32 > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA32 > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA32 > +#else > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA > +#endif How does using GFP_DMA make sense based on the above? If the system has more than 32-bits worth of RAM it should be using GFP_DMA32, else GFP_KERNEL, not GFP_DMA for an arch defined small addressability pool.