Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4266056imm; Wed, 30 May 2018 02:14:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKCF58rkClMI+iEzeQ7X2sx0HUhgURVJuXpo8sYcnKmd8FhiCPxyY7RGzlA8c8XPN/TYLq9 X-Received: by 2002:a62:5610:: with SMTP id k16-v6mr1983328pfb.19.1527671682987; Wed, 30 May 2018 02:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527671682; cv=none; d=google.com; s=arc-20160816; b=LjFCfLt875pjtZ9i1IKrBjoUCEOukuy/i6/mKmvTAso+wyETsmVRsv8bos614lvDhl mUpDuK52WR87C/fj8PfOk2twkaeAmRHeleojXcyVmJCiilUf5AOG0uo7YVXpbmzwJOEO EP/kL3/qSw9R9MVBuvhQ65ymsjTO/w8G1ll097urv3O05T1ml8c93iI2h346YSeEQh+K OLy8q5K5c7q1NtFlRSJEBEns2Et4inl9D4FtKqWDaCRKv3JX+bpHP/8ydiWvq+8ZGUYH 6SzgPpfPTLEHVRQLsgydlam8lJFXQyGwuyhmmypi0bxYreOn6ZQxidrIyKl1cKUmXc/M bT2w== 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:arc-authentication-results; bh=NK6+9aUnTQ189Yoj789jloBp17WC7sBL1ZVumlcBri4=; b=wsCSDuIdqIiFZsogWNV6m5+56ETOEgwa+iGW5P0286CUB6NKL08W8FqIUvLGvCuZyS 0tDfFSI+ona9Fy5VabLZvxUPEEgbnaSyur23RP+TCwz6XU/puGN+8bxsI8LLdT//oMG1 6QsexYRR2ibzM780qyROlSi6H3KULyWM4sEP+SIz0DftebVGpbrJDfDDJzMiHJyMLAsB eGJfNx07uAH0Peruv4e0H9EWiAAuRu1y8QA1bbLdYGq2ABC7ZGEqUWFEEJfLddhCWzvn QKntTrUyaO3tbm8KNHat/B+WLbYPYY2dZWEwv58js9Gp0wrR6DnIBPEwbRtmtSoIa+og rBDw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20-v6si35119350pfa.57.2018.05.30.02.14.29; Wed, 30 May 2018 02:14:42 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965331AbeE3JMQ (ORCPT + 99 others); Wed, 30 May 2018 05:12:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:40485 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964804AbeE3JMI (ORCPT ); Wed, 30 May 2018 05:12:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9353CACF3; Wed, 30 May 2018 09:12:06 +0000 (UTC) Date: Wed, 30 May 2018 11:12:06 +0200 From: Michal Hocko To: Huaisheng HS1 Ye Cc: "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "willy@infradead.org" , "vbabka@suse.cz" , "mgorman@techsingularity.net" , "kstewart@linuxfoundation.org" , "alexander.levin@verizon.com" , "gregkh@linuxfoundation.org" , "colyli@suse.de" , NingTing Cheng , Ocean HY1 He , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "xen-devel@lists.xenproject.org" , "linux-btrfs@vger.kernel.org" , Christoph Hellwig Subject: Re: [External] Re: [RFC PATCH v2 00/12] get rid of GFP_ZONE_TABLE/BAD Message-ID: <20180530091206.GB27180@dhcp22.suse.cz> References: <1526916033-4877-1-git-send-email-yehs2007@gmail.com> <20180522183728.GB20441@dhcp22.suse.cz> <20180524121853.GG20441@dhcp22.suse.cz> <20180528133733.GF27180@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 30-05-18 09:02:13, Huaisheng HS1 Ye wrote: > From: owner-linux-mm@kvack.org [mailto:owner-linux-mm@kvack.org] On Behalf Of Michal Hocko > Sent: Monday, May 28, 2018 9:38 PM > > > In my opinion, originally there shouldn't be such many wrong > > > combinations of these bottom 3 bits. For any user, whether or > > > driver and fs, they should make a decision that which zone is they > > > preferred. Matthew's idea is great, because with it the user must > > > offer an unambiguous flag to gfp zone bits. > > > > Well, I would argue that those shouldn't really care about any zones at > > all. All they should carea bout is whether they really need a low mem > > zone (aka directly accessible to the kernel), highmem or they are the > > allocation is generally movable. Mixing zones into the picture just > > makes the whole thing more complicated and error prone. > > Dear Michal, > > I don't quite understand that. I think those, mostly drivers, need to > get the correct zone they want. ZONE_DMA32 is an example, if drivers can be > satisfied with a low mem zone, why they mark the gfp flags as > 'GFP_KERNEL|__GFP_DMA32'? > GFP_KERNEL is enough to make sure a directly accessible low mem, but it is > obvious that they want to get a DMA accessible zone below 4G. They want a specific pfn range. Not a _zone_. Zone is an MM abstraction to manage memory. And not a great one as the time has shown. We have moved away from the per-zone reclaim because it just turned out to be problematic. Leaking this abstraction to users was a mistake IMHO. It was surely convenient but we can clearly see it was just confusing and many users just got it wrong. I do agree with Christoph in other email that the proper way for DMA users is to use the existing DMA API which is more towards what they need. Set a restriction on dma-able memory ranges. -- Michal Hocko SUSE Labs