From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by kanga.kvack.org (Postfix) with ESMTP id 136CD6B7F96 for ; Fri, 7 Dec 2018 03:49:08 -0500 (EST) Received: by mail-pl1-f199.google.com with SMTP id 4so2243093plc.5 for ; Fri, 07 Dec 2018 00:49:08 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c10sor4269165pgq.28.2018.12.07.00.49.06 for (Google Transport Security); Fri, 07 Dec 2018 00:49:07 -0800 (PST) MIME-Version: 1.0 References: <20181207061620.107881-1-drinkcat@chromium.org> <20181207061620.107881-3-drinkcat@chromium.org> <20181207080551.GA15120@bombadil.infradead.org> In-Reply-To: <20181207080551.GA15120@bombadil.infradead.org> From: Nicolas Boichat Date: Fri, 7 Dec 2018 16:48:54 +0800 Message-ID: Subject: Re: [PATCH v5 2/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Matthew Wilcox 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 Mailing List , iommu@lists.linux-foundation.org, lkml , linux-mm@kvack.org, Yong Wu , Matthias Brugger , Tomasz Figa , yingjoe.chen@mediatek.com, hch@infradead.org On Fri, Dec 7, 2018 at 4:05 PM Matthew Wilcox wrote: > > On Fri, Dec 07, 2018 at 02:16:19PM +0800, Nicolas Boichat wrote: > > +#ifdef CONFIG_ZONE_DMA32 > > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA32 > > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA32 > > This name doesn't make any sense. Why not ARM_V7S_TABLE_SLAB_FLAGS ? Sure, will fix in v6 then. > > +#else > > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA > > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA > > Can you remind me again why it is, on machines which don't support > ZONE_DMA32, why we have to allocate from ZONE_DMA? My understanding > is that 64-bit machines have ZONE_DMA32 and 32-bit machines don't. > So shouldn't this rather be GFP_KERNEL? Sorry I mean to reply on the v4 thread, Christoph raised the same question (https://patchwork.kernel.org/patch/10713025/). I don't know, and I don't have all the hardware needed to test this ,-( Robin and Will both didn't seem sure. I'd rather not introduce a new regression, this patch series tries to fix a known arm64 regression, where we _need_ tables to be in DMA32. If we want to change 32-bit hardware to use GFP_KERNEL, and we're sure it works, that's fine by me, but it should be in another patch set. Hope this makes sense, Thanks, > Actually, maybe we could centralise this in gfp.h: > > #ifdef CONFIG_64BIT > # ifdef CONFIG_ZONE_DMA32 > #define GFP_32BIT GFP_DMA32 > # else > #define GFP_32BIT GFP_DMA > #else /* 32-bit */ > #define GFP_32BIT GFP_KERNEL > #endif >