Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425255AbdD1JF6 (ORCPT ); Fri, 28 Apr 2017 05:05:58 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:25415 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165005AbdD1JFp (ORCPT ); Fri, 28 Apr 2017 05:05:45 -0400 Subject: Re: Generic approach to customizable zones - was: Re: [PATCH v7 0/7] Introduce ZONE_CMA To: Michal Hocko References: <1491880640-9944-1-git-send-email-iamjoonsoo.kim@lge.com> <20170411181519.GC21171@dhcp22.suse.cz> <20170412013503.GA8448@js1304-desktop> <20170413115615.GB11795@dhcp22.suse.cz> <20170417020210.GA1351@js1304-desktop> <20170424130936.GB1746@dhcp22.suse.cz> <20170425034255.GB32583@js1304-desktop> <20170427150636.GM4706@dhcp22.suse.cz> <20170428083625.GG8143@dhcp22.suse.cz> CC: Joonsoo Kim , Andrew Morton , Rik van Riel , Johannes Weiner , , Laura Abbott , "Minchan Kim" , Marek Szyprowski , "Michal Nazarewicz" , "Aneesh Kumar K . V" , Vlastimil Babka , "Russell King" , Will Deacon , , , From: Igor Stoppa Message-ID: <94c6467f-39a8-9819-9a57-8229cefd7971@huawei.com> Date: Fri, 28 Apr 2017 12:04:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170428083625.GG8143@dhcp22.suse.cz> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.122.225.51] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.590305CB.007A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3c7f61008b0f931e51c81abe2573856e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2303 Lines: 69 On 28/04/17 11:36, Michal Hocko wrote: > I didn't read this thoughly yet because I will be travelling shortly ok, thanks for bearing with me =) > but > this point alone just made ask, because it seems there is some > misunderstanding It is possible, so far I did some changes, but I have not completed the whole conversion. > On Fri 28-04-17 11:04:27, Igor Stoppa wrote: > [...] >> * if one is happy to have a 64bits type, allow for as many zones as >> it's possible to fit, or anyway more than what is possible with >> the 32 bit mask. > > zones are currently placed in struct page::flags. And that already is > 64b size on 64b arches. Ok, the issues I had so fare were related to the enum for zones being treated as 32b. > And we do not really have any room spare there. > We encode page flags, zone id, numa_nid/sparse section_nr there. How can > you add more without enlarging the struct page itself or using external > means to store the same information (page_ext comes to mind)? Then I'll be conservative and assume I can't, unless I can prove otherwise. There is still the possibility I mentioned of loosely coupling DMA, DMA32 and HIGHMEM with the bits currently reserved for them, right? If my system doesn't use those zones as such, because it doesn't have/need them, those bits are wasted for me. Otoh someone else is probably not interested in what I'm after but needs one or more of those zones. Making the meaning of the bits configurable should still be a viable option. It's not altering their amount, just their purpose on a specific build. > Even if > the later would be possible then note thatpage_zone() is used in many > performance sensitive paths and making it perform well with special > casing would be far from trivial. If the solution I propose is acceptable, I'm willing to bite the bullet and go for implementing the conversion. In my case I really would like to be able to use kmalloc, because it would provide an easy path to convert also other portions of the kernel, besides SE Linux. I suspect I would encounter overall far less resistance if the type of change I propose is limited to: s/GFP_KERNEL/GFP_LOCKABLE/ And if I can guarrantee that GFP_LOCKABLE falls back to GFP_KERNEL when the "lockable" feature is not enabled. -- thanks, igor