[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c45bab6-8c29-e227-56b8-307e8bee46c6@suse.cz>
Date: Mon, 20 Apr 2020 13:37:44 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Matthew Wilcox <willy@...radead.org>, js1304@...il.com
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Laura Abbott <labbott@...hat.com>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.ibm.com>,
Mel Gorman <mgorman@...hsingularity.net>,
Michal Hocko <mhocko@...e.com>,
Johannes Weiner <hannes@...xchg.org>,
Roman Gushchin <guro@...com>, Minchan Kim <minchan@...nel.org>,
Rik van Riel <riel@...riel.com>,
Christian Koenig <christian.koenig@....com>,
Huang Rui <ray.huang@....com>,
Eric Biederman <ebiederm@...ssion.com>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>,
Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCH 01/10] mm/page-flags: introduce PageHighMemZone()
On 4/20/20 1:20 PM, Matthew Wilcox wrote:
> On Mon, Apr 20, 2020 at 04:59:33PM +0900, js1304@...il.com wrote:
>> ZONE_MOVABLE is special. It is considered as normal type zone on
>> !CONFIG_HIGHMEM, but, it is considered as highmem type zone
>> on CONFIG_HIGHMEM. Let's focus on later case. In later case, all pages
>> on the ZONE_MOVABLE has no direct mapping until now.
>>
>> However, following patchset
>> "mm/cma: manage the memory of the CMA area by using the ZONE_MOVABLE"
>> , which is once merged and reverted, will be tried again and will break
>> this assumption that all pages on the ZONE_MOVABLE has no direct mapping.
>> Hence, the ZONE_MOVABLE which is considered as highmem type zone could
>> have the both types of pages, direct mapped and not. Since
>> the ZONE_MOVABLE could have both type of pages, __GFP_HIGHMEM is still
>> required to allocate the memory from it. And, we conservatively need to
>> consider the ZONE_MOVABLE as highmem type zone.
>
> I don't understand why CMA allocating pages from ZONE_MOVABLE somehow
> gives these pages a direct mapping. Maybe you have a freaky layout in
> the architecture that makes no sense and that's what needs to be fixed?
>
> My understanding of the zones is based on x86, and it looks like this
> on a 32-bit system with 8GB of memory:
>
> ZONE_DMA 0-16MB
> ZONE_NORMAL 16-896MB
> ZONE_HIGHMEM 896-xMB
> ZONE_MOVABLE x-8192MB
>
> where x is a boot option used to partition the highmem between movable
> and unmovable.
>
> Now, why would allocating the CMA from ZONE_NORMAL suddenly make these
> pages part of the direct mapping?
I assume the scenario is that ZONE_MOVABLE could extend into today's ZONE_NORMAL
range, which is the range covered by direct mapping.
At that point, testing page's zone stops being a reliable test of "does this
page have direct mapping"?
I don't know the exact motivation why that will happen but I can imagine two.
1) some CMA user needs the CMA allocations to be in direct mapping range
2) the amount of CMA memory reservation required is so high it won't fit in
highmem range only.
Powered by blists - more mailing lists