Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1528770imu; Thu, 22 Nov 2018 18:19:54 -0800 (PST) X-Google-Smtp-Source: AJdET5fcBKBW0o5QqB7XT89Tblcgve6VsTiryabwpAcazFGn4asfUW5PrxjCyyn4/M5MzXbnwwhz X-Received: by 2002:a62:1709:: with SMTP id 9mr13774765pfx.249.1542939594147; Thu, 22 Nov 2018 18:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542939594; cv=none; d=google.com; s=arc-20160816; b=VfFyFoMR+YdXdOdexKwnc/IsxdX8lfwm6NPvr2apGTRTovNDOmB3iq9EfWOOEun83u PXu35IXhm0OqzMLWmKxE7z8fJOTQVAnDeqxPMf10s37NMuBZVW+V/jvKSeq9A4QeiTFZ Z7MyKrrqKf0UOggsol3Q22LWRj5rcW+XZDXJJnqXeWPEJ7tCEm+qASczT+x5zDnwitQM aRE2kJZRXPUe8cp5oCC8zb0GmJ0P8DAXwqx4LkeAOCeOcZVwHcipCoawWuQLyIUAmWnu 6uShMVJBh0reOzhoQA0H0EqzyCDm1NbSGF/3f3JYZGFP7VUHPG5RVHnbZWpH2FUVqx+I Y8qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XW9l0J9+/u1CtTbGj4CdPF0IGOMeVGwu5iVHuX/8c5w=; b=GydBWDuA14pvn00Ny76CRPAAqoZe3jcovC6+v62ci99RvwdFam4D+2VgraLi73zbc/ YEuqa71ZxABJHq7VHGIloCLjgnGuVblK2nN3YGUzmPXSXuLNvtTrGE8NtqxEeH07kf2C FX56vbFBFrDBlEbG2mJh9fu4AMc3LQi7R0lR7633CCZEXZqBNaRrIATOzDbX0bVs3Ri2 zZQo6ydWkxr5Y1RjnYTNJVk22I/7DsdvfZROv4WfD+M1HoIpVYMLh4V8dA7Ub9FmGvKv 51txNN2KUz70EU2AqahWvEZN1vaBQ16R2EeSENrHJmBrrX5V5nqMkmPa+12BRjL49/Wf iSdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="KnK/Cswf"; 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 k142si36031931pfd.174.2018.11.22.18.19.39; Thu, 22 Nov 2018 18:19:54 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="KnK/Cswf"; 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 S2392970AbeKVTEi (ORCPT + 99 others); Thu, 22 Nov 2018 14:04:38 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:42008 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730714AbeKVTEi (ORCPT ); Thu, 22 Nov 2018 14:04:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XW9l0J9+/u1CtTbGj4CdPF0IGOMeVGwu5iVHuX/8c5w=; b=KnK/CswfB/AnWnQICIUPVdvqQ rPaVNdVKB67jItg5DT2nj8eV1uQafOTjgV0sQktBmgdAS3FdnE87Lo9HX5MbBoQrUpLNrrA5ZCLQQ L7PfcBtKzd/u7pbTYKrOtoAEWk1IAUz1Y0Dj9bnRKyahyKqCL//Jmb8qUgENZSgvasQHxH0EAI0bO qGFMM3R25+MqOMGxLZc8E9jRrnPemUVWZCGpzENY8Yg+5DfPosnXrqOktbew1N1Mz4GEfyaX/s3Wh A/kObycgMPofIsEUzUTc5Q30mhea/KKsy4awKvkGY4jZNo5dQprRoxxx/DGUSYgX9x2sZr0MLI5pR ycjm/3gRQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPkJG-0003Ug-Sd; Thu, 22 Nov 2018 08:26:02 +0000 Date: Thu, 22 Nov 2018 00:26:02 -0800 From: Christoph Hellwig To: Matthew Wilcox Cc: Robin Murphy , Michal Hocko , Will Deacon , Levin Alexander , linux-mm@kvack.org, Christopher Lameter , Nicolas Boichat , Huaisheng Ye , David Rientjes , yingjoe.chen@mediatek.com, Vlastimil Babka , Tomasz Figa , Mike Rapoport , Matthias Brugger , Joonsoo Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pekka Enberg , iommu@lists.linux-foundation.org, Andrew Morton , Mel Gorman Subject: Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables Message-ID: <20181122082602.GB2049@infradead.org> References: <20181111090341.120786-1-drinkcat@chromium.org> <0100016737801f14-84f1265d-4577-4dcf-ad57-90dbc8e0a78f-000000@email.amazonses.com> <20181121213853.GL3065@bombadil.infradead.org> <20181122023558.GO3065@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181122023558.GO3065@bombadil.infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 21, 2018 at 06:35:58PM -0800, Matthew Wilcox wrote: > I think you should look at using the page_frag allocator here. You can > use whatever GFP_DMA flags you like. So I actually tries to use page_frag to solve the XFS unaligned kmalloc allocations problem, and I don't think it is the right hammer for this nail (or any other nail outside of networking). The problem with the page_frag allocator is that it never reuses fragments returned to the page, but only only frees the page once all fragments are freed. This means that if you have some long(er) term allocations you are effectively creating memory leaks.