Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2773400imu; Fri, 23 Nov 2018 14:37:49 -0800 (PST) X-Google-Smtp-Source: AJdET5coYd1DloricU1+n/RdgXXmrxBFn+xWWt2MObU66Rsa+oqqDQmXkM93QD2Jdvu/BlLQWvI9 X-Received: by 2002:a62:6204:: with SMTP id w4mr18042630pfb.5.1543012669186; Fri, 23 Nov 2018 14:37:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543012669; cv=none; d=google.com; s=arc-20160816; b=lpVc/m7+hcaCPMbWhVcvS9rDqAG9KM3jsxbe8DL21XXgDu9JopB5yFQPPRvxElapkQ M/x76HEWi/rl49/j71vH8pk7KdpGbZ0NCkqENbIfksmWo96zxC2VmqdtJex/F0k9wUvS sVj3KX7hIjMOT83lLHBg5BIuf2/b19WvWyr5pjzSC4K/Xr3RonsK/NJWyyCGOJDn8Hc0 C2Rq2JvK1rNdGmMhw+phjtSaSuB++3BJJxS8G+kWMkANG9Kh/NyQjSk6TlCMbjqIBQen 4bH5nSeP1Zt4xmhZtoejf1U5W8YFsL5N8z8NvE+7/qDMBNZk4zMk8gW5OXAk03uHh/++ aepA== 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=nWrZgwa7r2a/FhuhYkmj1dUm7Z3eStSfH9e6ex5hZcc=; b=iLrSV1jx3aiNoGZLXwdiO76korbc187R73DKiXNROBRNmGnsS2uBe2LsAFlmBArS2m U4JVVEyRfiieViEWc4QL2TaSn+DQJu0K7uPai1Hc4MD0ha3kIbCB1ub9KYedhIEB66bV 63maveCRi4dOjaby2phQSlJFAZbd7WvSzPXfe4dVUSA96ykHKnIyJiDDB9BubeKTHJzT 9zBE166FOL2lZ4XUQKd6tZdLyESomT0vw7hdHb9vmhruHqAp9AbHwlsxAiL9J8zCxzN8 70FqLsWmUM9WBfLMKxTf2OmRs2YzL6Ag5c4f9XfGg+/xbWP+knNlQHQLix3411Cts5wz da8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mFHb07Tw; 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 r197si24305089pfr.192.2018.11.23.14.37.31; Fri, 23 Nov 2018 14:37:49 -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=mFHb07Tw; 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 S2437530AbeKWB4a (ORCPT + 99 others); Thu, 22 Nov 2018 20:56:30 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:39684 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437521AbeKWB4a (ORCPT ); Thu, 22 Nov 2018 20:56:30 -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=nWrZgwa7r2a/FhuhYkmj1dUm7Z3eStSfH9e6ex5hZcc=; b=mFHb07TwwuWQZZvcDIZ2QSpbx ctkN27i19y2RPVd4QvnXxzOfzxqTCcTVX6+swAiw0S/vhF5qI8UQ5kYgdEXM8Lu0iIootX6fDxMxB svoQGiNDrzjAL/DukFJ8psp/TI+md80m7r8Dx5jvcuF3HnHTv5Xgez6rcBdbOLRQXvfQjyqOrCPLC Ea536gR4a6AMuLbzWYdui2opM8o3GlLoPM6xq6s5Bja56tL8UOk0qJuZHUL+/ZeI4THy5rLoZZhLT nDXnX9A+XAYYjhec5BXljOox2eKOCBAItaKAUBC4k7cztoFU+2zqr6t46wTwZUGNNjsw1RK/cknsh FAocP1jHw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPqiW-0000Ck-CM; Thu, 22 Nov 2018 15:16:32 +0000 Date: Thu, 22 Nov 2018 07:16:32 -0800 From: Matthew Wilcox To: Christoph Hellwig 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: <20181122151632.GP3065@bombadil.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> <20181122082602.GB2049@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181122082602.GB2049@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 12:26:02AM -0800, Christoph Hellwig wrote: > 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. Yes, your allocations from the page_frag allocator have to have similar lifetimes. I thought that would be ideal for XFS though; as I understood the problem, these were per-IO allocations, and IOs to the same filesystem tend to take roughly the same amount of time. Sure, in an error case, some IOs will take a long time before timing out, but it should be OK to have pages unavailable during that time in these rare situations. What am I missing?